ERE ZIJ ODIN

This commit is contained in:
malloc 2018-02-20 18:07:03 -06:00
parent 6087d8261a
commit 49a3eae324
2 changed files with 39 additions and 4 deletions

View file

@ -1,3 +1,17 @@
#include "string.hpp" #include "string.hpp"
using namespace sosc::util::str;
std::string sosc::str::trim(std::string str) {
return rtrimr(ltrimr(str));
}
std::string* sosc::str::trim(std::string* str) {
return rtrim(ltrim(str));
}
std::string& sosc::str::trimr(std::string& str) {
return rtrimr(ltrimr(str));
}
std::string sosc::str::rtrim(std::string str) {
int marker = 0;
}

View file

@ -1,10 +1,31 @@
#ifndef SOSC_UTIL_STRING_H #ifndef SOSC_UTIL_STRING_H
#define SOSC_UTIL_STRING_H #define SOSC_UTIL_STRING_H
#include <string>
namespace sosc { namespace sosc {
namespace util { namespace str {
namespace str { std::string trim (std::string str);
std::string* trim (std::string* str);
std::string& trimr(std::string& str);
}}} std::string rtrim (std::string str);
std::string* rtrim (std::string* str);
std::string& rtrimr(std::string& str);
std::string ltrim (std::string str);
std::string* ltrim (std::string* str);
std::string& ltrimr(std::string& str);
std::vector<std::string> split
(const std::string& str, char delimiter, int count = -1);
std::vector<std::string> split
(const std::string& str, std::string delimiter, int count = -1);
std::string join(const std::vector<std::string>& strs,
char delimiter, int count = -1);
std::string join(const std::vector<std::string>& strs,
std::string delimiter, int count = -1);
}}
#endif #endif