]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blobdiff - Server/include/plaqui/server/string.h
- Se sobreescribe el método Connection::finish() para que cierre el socket.
[z.facultad/75.42/plaqui.git] / Server / include / plaqui / server / string.h
index 8ab2b8f447ffd4a10b594853d6135a2db8e998ab..ecd253a8bc53e251aadcb34ab35fbee9112dbe4c 100644 (file)
@@ -29,6 +29,7 @@
 #define PLAQUI_STRING_H
 
 #include <string>
 #define PLAQUI_STRING_H
 
 #include <string>
+#include <vector>
 
 namespace PlaQui {
 
 
 namespace PlaQui {
 
@@ -45,7 +46,12 @@ namespace Server {
                        /**
                         * Destructor.
                         */
                        /**
                         * Destructor.
                         */
-                       virtual ~String(void) {}
+                       virtual ~String(void);
+
+                       /**
+                        * Constructor.
+                        */
+                       String(void);
 
                        /**
                         * Constructor.
 
                        /**
                         * Constructor.
@@ -54,6 +60,17 @@ namespace Server {
                         */
                        String(const std::string& str);
 
                         */
                        String(const std::string& str);
 
+                       /**
+                        * Constructor a partir de un vector.
+                        * Convierte el vector en string uniendo sus componentes a traves
+                        * del separador.
+                        *
+                        * \param v   Vector.
+                        * \param sep Separador.
+                        */
+                       String(const std::vector<std::string>& v,
+                                       const std::string& sep);
+
                        /**
                         * Elmina caracteres al inicio y fin de un string.
                         *
                        /**
                         * Elmina caracteres al inicio y fin de un string.
                         *
@@ -71,6 +88,22 @@ namespace Server {
                         */
                        String& to_lower(void);
 
                         */
                        String& to_lower(void);
 
+                       /**
+                        * Fracciona una cadena convirtiendola en un vector.
+                        *
+                        * \param sep Caracter usado como separador.
+                        */
+                       std::vector<std::string> split(char sep) const;
+
+                       /**
+                        * Concatena los elementos de un vector.
+                        *
+                        * \param v   Vector.
+                        * \param sep Separador.
+                        */
+                       static String join(const std::vector<std::string>& v,
+                                       const std::string& sep);
+
        };
 
 }
        };
 
 }