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
NamedColumnsParser.h
Go to the documentation of this file.
1
/****************************************************************************/
8
// A parser to retrieve information from a table with known columns
9
/****************************************************************************/
10
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
11
// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
12
/****************************************************************************/
13
//
14
// This file is part of SUMO.
15
// SUMO is free software: you can redistribute it and/or modify
16
// it under the terms of the GNU General Public License as published by
17
// the Free Software Foundation, either version 3 of the License, or
18
// (at your option) any later version.
19
//
20
/****************************************************************************/
21
#ifndef NamedColumnsParser_h
22
#define NamedColumnsParser_h
23
24
25
// ===========================================================================
26
// included modules
27
// ===========================================================================
28
#ifdef _MSC_VER
29
#include <
windows_config.h
>
30
#else
31
#include <
config.h
>
32
#endif
33
34
#include <map>
35
#include <string>
36
#include <
utils/common/StringTokenizer.h
>
37
38
39
// ===========================================================================
40
// class definitions
41
// ===========================================================================
58
class
NamedColumnsParser
{
59
public
:
64
NamedColumnsParser
() ;
65
66
79
NamedColumnsParser
(
const
std::string& def,
const
std::string& defDelim =
";"
,
80
const
std::string& lineDelim =
";"
,
bool
chomp =
false
,
81
bool
ignoreCase =
true
) ;
82
83
85
~NamedColumnsParser
() ;
86
87
99
void
reinit
(
const
std::string& def,
const
std::string& defDelim =
";"
,
100
const
std::string& lineDelim =
";"
,
bool
chomp =
false
,
101
bool
ignoreCase =
true
) ;
102
103
112
void
parseLine
(
const
std::string& line) ;
113
114
129
std::string
get
(
const
std::string& name,
130
bool
prune =
false
)
const
throw
(
UnknownElement
,
OutOfBoundsException
);
131
132
138
bool
know
(
const
std::string& name)
const
;
139
140
145
bool
hasFullDefinition
()
const
;
146
147
148
private
:
161
void
reinitMap
(std::string def,
const
std::string& delim =
";"
,
162
bool
chomp =
false
) ;
163
164
173
void
checkPrune
(std::string& str,
bool
prune)
const
;
174
175
176
private
:
178
typedef
std::map<std::string, size_t>
PosMap
;
179
181
PosMap
myDefinitionsMap
;
182
184
std::string
myLineDelimiter
;
185
187
StringTokenizer
myLineParser
;
188
190
bool
myAmCaseInsensitive
;
191
192
};
193
194
195
#endif
196
197
/****************************************************************************/
198
tmp
buildd
sumo-0.15.0~dfsg
src
utils
importio
NamedColumnsParser.h
Generated on Sun May 27 2012 14:52:07 for SUMO - Simulation of Urban MObility by
1.8.1