ERE ZIJ ODIN
This commit is contained in:
parent
6087d8261a
commit
49a3eae324
2 changed files with 39 additions and 4 deletions
|
@ -1,3 +1,17 @@
|
|||
#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;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,31 @@
|
|||
#ifndef SOSC_UTIL_STRING_H
|
||||
#define SOSC_UTIL_STRING_H
|
||||
|
||||
namespace sosc {
|
||||
namespace util {
|
||||
namespace str {
|
||||
#include <string>
|
||||
|
||||
}}}
|
||||
namespace sosc {
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue