1
0
Fork 0

DBG: StringList typedef

This commit is contained in:
Mr. eXoDia 2014-12-10 21:59:01 +01:00
parent 52512b8af5
commit 8aa848b467
2 changed files with 6 additions and 4 deletions

View File

@ -3,7 +3,7 @@
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
std::vector<String> StringUtils::Split(const String & s, char delim, std::vector<String> & elems) StringList StringUtils::Split(const String & s, char delim, std::vector<String> & elems)
{ {
std::stringstream ss(s); std::stringstream ss(s);
String item; String item;
@ -16,7 +16,7 @@ std::vector<String> StringUtils::Split(const String & s, char delim, std::vector
return elems; return elems;
} }
std::vector<String> StringUtils::Split(const String & s, char delim) StringList StringUtils::Split(const String & s, char delim)
{ {
std::vector<String> elems; std::vector<String> elems;
Split(s, delim, elems); Split(s, delim, elems);

View File

@ -6,12 +6,14 @@
typedef std::string String; typedef std::string String;
typedef std::wstring WString; typedef std::wstring WString;
typedef std::vector<String> StringList;
typedef std::vector<WString> WStringList;
class StringUtils class StringUtils
{ {
public: public:
static std::vector<String> Split(const String & s, char delim, std::vector<String> & elems); static StringList Split(const String & s, char delim, std::vector<String> & elems);
static std::vector<String> Split(const String & s, char delim); static StringList Split(const String & s, char delim);
static String Trim(const String & s); static String Trim(const String & s);
static String TrimLeft(const String & s); static String TrimLeft(const String & s);
static String TrimRight(const String & s); static String TrimRight(const String & s);