SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
StringTokenizer.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// A java-style StringTokenizer for c++ (stl)
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
12
// Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
13
/****************************************************************************/
14
//
15
// This file is part of SUMO.
16
// SUMO is free software: you can redistribute it and/or modify
17
// it under the terms of the GNU General Public License as published by
18
// the Free Software Foundation, either version 3 of the License, or
19
// (at your option) any later version.
20
//
21
/****************************************************************************/
22
#ifndef StringTokenizer_h
23
#define StringTokenizer_h
24
25
26
// ===========================================================================
27
// included modules
28
// ===========================================================================
29
#ifdef _MSC_VER
30
#include <
windows_config.h
>
31
#else
32
#include <
config.h
>
33
#endif
34
35
#include <string>
36
#include <vector>
37
64
// ===========================================================================
65
// class definitions
66
// ===========================================================================
70
class
StringTokenizer
{
71
public
:
73
static
const
int
NEWLINE
;
74
77
static
const
int
WHITECHARS
;
78
80
static
const
int
SPACE
;
81
82
public
:
84
StringTokenizer
() { }
85
90
StringTokenizer
(std::string tosplit);
91
97
StringTokenizer
(std::string tosplit, std::string token,
bool
splitAtAllChars =
false
);
98
106
StringTokenizer
(std::string tosplit,
int
special);
107
109
~StringTokenizer
();
110
112
void
reinit
();
113
115
bool
hasNext
();
116
119
std::string
next
();
120
122
size_t
size
()
const
;
123
125
std::string
front
();
126
128
std::string
get
(
size_t
pos)
const
;
129
130
std::vector<std::string>
getVector
();
131
132
private
:
135
void
prepare
(
const
std::string& tosplit,
const
std::string& token,
136
bool
splitAtAllChars);
137
139
void
prepareWhitechar
(
const
std::string& tosplit);
140
141
private
:
143
typedef
std::vector<size_t>
SizeVector
;
144
146
std::string
myTosplit
;
147
149
size_t
myPos
;
150
152
SizeVector
myStarts
;
153
155
SizeVector
myLengths
;
156
157
};
158
159
160
#endif
161
162
/****************************************************************************/
163
build
buildd
sumo-0.18~dfsg
src
utils
common
StringTokenizer.h
Generated on Wed Oct 23 2013 01:15:12 for SUMO - Simulation of Urban MObility by
1.8.4