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
7std::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
20std::string convert::input::Parser::getDirectory(const std::string &fileName) {
21 return fileName.substr(0, fileName.find_last_of("/\\") +1);
22}
23
24
25std::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}
static std::string getDirectory(const std::string &fileName)
Definition Parser.cpp:20
static std::vector< std::string > tokenise(const std::string &line)
Definition Parser.cpp:7
static std::string removeHyphens(const std::string &value)
Definition Parser.cpp:25