39 #ifdef CHECK_MEMORY_LEAKS 41 #endif // CHECK_MEMORY_LEAKS 57 : myTosplit(tosplit), myPos(0) {
64 prepare(tosplit, token, splitAtAllChars);
81 char* buf =
new char[2];
82 buf[0] = (char) special;
143 int len = (int)token.length();
144 if (splitAtAllChars) {
147 while (beg < (
int)tosplit.length()) {
148 std::string::size_type end;
149 if (splitAtAllChars) {
150 end = tosplit.find_first_of(token, beg);
152 end = tosplit.find(token, beg);
154 if (end == std::string::npos) {
155 end = tosplit.length();
159 beg = (int)end + len;
160 if (beg == (
int)tosplit.length()) {
168 std::string::size_type len = tosplit.length();
169 std::string::size_type beg = 0;
170 while (beg < len && tosplit[beg] <=
SPACE) {
173 while (beg != std::string::npos && beg < len) {
174 std::string::size_type end = beg;
175 while (end < len && tosplit[end] >
SPACE) {
179 myLengths.push_back((
int)end - (
int)beg);
181 while (beg < len && tosplit[beg] <=
SPACE) {
187 std::vector<std::string>
189 std::vector<std::string> ret;
192 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)