39 #ifdef CHECK_MEMORY_LEAKS 41 #endif // CHECK_MEMORY_LEAKS 56 : myTosplit(tosplit), myPos(0) {
63 prepare(tosplit, token, splitAtAllChars);
77 char* buf =
new char[2];
78 buf[0] = (char) special;
139 int len = (int)token.length();
140 if (splitAtAllChars) {
143 while (beg < (
int)tosplit.length()) {
144 std::string::size_type end;
145 if (splitAtAllChars) {
146 end = tosplit.find_first_of(token, beg);
148 end = tosplit.find(token, beg);
150 if (end == std::string::npos) {
151 end = tosplit.length();
155 beg = (int)end + len;
156 if (beg == tosplit.length()) {
164 std::string::size_type len = tosplit.length();
165 std::string::size_type beg = 0;
166 while (beg < len && tosplit[beg] <=
SPACE) {
169 while (beg != std::string::npos && beg < len) {
171 while (end < len && tosplit[end] >
SPACE) {
177 while (beg < len && tosplit[beg] <=
SPACE) {
183 std::vector<std::string>
185 std::vector<std::string> ret;
188 ret.push_back(
next());
static const int WHITECHARS
void prepare(const std::string &tosplit, const std::string &token, bool splitAtAllChars)
std::vector< std::string > getVector()
std::string get(int pos) const
void prepareWhitechar(const std::string &tosplit)