X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/ffe5447aa2d71b5296cbdd36c48d5f9d59e249af..c90e905d76aed75379d220478e97fda0d34ec59b:/Server/include/plaqui/server/command.h?ds=sidebyside diff --git a/Server/include/plaqui/server/command.h b/Server/include/plaqui/server/command.h index 019cad2..0074557 100644 --- a/Server/include/plaqui/server/command.h +++ b/Server/include/plaqui/server/command.h @@ -28,7 +28,9 @@ #ifndef PLAQUI_COMMAND_H #define PLAQUI_COMMAND_H +#include "httperror.h" #include "httprequest.h" +#include #include #include #include @@ -80,8 +82,8 @@ namespace Server { /** * Constructor. */ - Command(const std::string& target = "", - const std::string& command = ""); + Command(const std::string& _target = "", + const std::string& _command = ""); /** * Establece el destino. @@ -91,7 +93,7 @@ namespace Server { /** * Obtiene el destino. */ - const std::string& get_target(void); + const std::string& get_target(void) const; /** * Establece el comando. @@ -101,7 +103,7 @@ namespace Server { /** * Obtiene el comand. */ - const std::string& get_command(void); + const std::string& get_command(void) const; /** * Establece los argumentos. @@ -111,24 +113,29 @@ namespace Server { /** * Obtiene los argumentos. */ - const Arguments& get_args(void); + const Arguments& get_args(void) const; /** - * Agrega un argumentos. + * Agrega un argumento. */ void add_arg(const std::string& arg); + /** + * Agrega un argumento. + */ + void add_arg(const unsigned& arg); + /** * Obtiene el comando desde un pedido HTTP completo. */ friend std::istream& operator>>(std::istream& is, - Command& command); + Command& command) throw(HTTPError, sockerr, ios::failure); /** * Convierte el comando a un pedido HTTP completo. */ friend std::ostream& operator<<(std::ostream& os, - const Command& command); + const Command& command) throw(sockerr); };