X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/2f5c973fdf3f7fb25b13996b66d566c58066f6a0..b804b4bd1f222976f6a1fb3156fede8e26e32d3d:/Server/include/plaqui/server/command.h?ds=inline diff --git a/Server/include/plaqui/server/command.h b/Server/include/plaqui/server/command.h index fafa951..6f78b53 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 @@ -41,6 +43,7 @@ namespace Server { /// Pedido HTTP. class Command: private HTTPRequest { + ///////////////////////////////////////////////////////////////////// // Tipos. public: @@ -48,6 +51,7 @@ namespace Server { /// Tipo de métodos HTTP reconocidos. typedef std::vector Arguments; + ///////////////////////////////////////////////////////////////////// // Atributos. private: @@ -61,6 +65,7 @@ namespace Server { /// Lista de argumentos que recibe el comando. Arguments args; + ///////////////////////////////////////////////////////////////////// // Métodos. private: @@ -80,8 +85,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. @@ -114,21 +119,26 @@ namespace Server { 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); };