Peano
Loading...
Searching...
No Matches
Parser.cpp
Go to the documentation of this file.
1
#include "
Parser.h
"
2
3
4
#include <sstream>
5
6
7
std::vector<std::string>
convert::input::Parser::tokenise
(
const
std::string& line ) {
8
std::vector<std::string> result;
9
10
std::istringstream ss(line);
11
std::string token;
12
while
(ss >> token) {
13
result.push_back( token );
14
}
15
16
return
result;
17
}
18
19
20
std::string
convert::input::Parser::getDirectory
(
const
std::string &fileName) {
21
return
fileName.substr(0, fileName.find_last_of(
"/\\"
) +1);
22
}
23
24
25
std::string
convert::input::Parser::removeHyphens
(
const
std::string& value ) {
26
std::string result = value;
27
if
(result.at(result.size()-1)==
'"'
) {
28
result = result.substr(0,result.size()-1);
29
}
30
if
(result.at(0)==
'"'
) {
31
result = result.substr(1);
32
}
33
return
result;
34
}
Parser.h
convert::input::Parser::getDirectory
static std::string getDirectory(const std::string &fileName)
Definition
Parser.cpp:20
convert::input::Parser::tokenise
static std::vector< std::string > tokenise(const std::string &line)
Definition
Parser.cpp:7
convert::input::Parser::removeHyphens
static std::string removeHyphens(const std::string &value)
Definition
Parser.cpp:25
src
convert
input
Parser.cpp
Generated on Fri Apr 11 2025 10:17:45 for Peano by
1.10.0