FFEA_input_reader.h
Go to the documentation of this file.
1 //
2 // This file is part of the FFEA simulation package
3 //
4 // Copyright (c) by the Theory and Development FFEA teams,
5 // as they appear in the README.md file.
6 //
7 // FFEA is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // FFEA is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with FFEA. If not, see <http://www.gnu.org/licenses/>.
19 //
20 // To help us fund FFEA development, we humbly ask that you cite
21 // the research papers on the package.
22 //
23 
24 #ifndef FFEA_INPUT_READER
25 #define FFEA_INPUT_READER
26 
27 #include <vector>
28 #include <string>
29 #include <iostream>
30 #include <fstream>
31 #include <boost/algorithm/string.hpp>
32 #include "FFEA_return_codes.h"
33 #include "mat_vec_types.h"
34 
35 using namespace std;
36 
39 
40  public:
43 
44 
46  int file_to_lines(string script_fname, vector<string> *output);
47 
49  int extract_block(string block_title, int block_index, vector<string> input, vector<string> *output, bool mandatory=true);
50 
52  int parse_tag(string input, string *output);
53 
55  int parse_map_tag(string input, int *map_indices, string *map_fname);
56 
58  int split_string(string input, string *output, string delim);
59 
61  int split_string(string input, vector<string> &output, string delim);
62 
64  int split_string(string input, int *output, string delim);
65 
67  int split_string(string input, scalar *output, string delim);
68 
69  private:
70 
71  string buf_string;
72  int copying;
73  vector<string>::iterator string_it;
74 
75 };
76 
77 #endif
int copying
Definition: FFEA_input_reader.h:72
STL namespace.
vector< string >::iterator string_it
Definition: FFEA_input_reader.h:73
string buf_string
Definition: FFEA_input_reader.h:71
Definition: FFEA_input_reader.h:38
double scalar
Definition: mat_vec_types.h:36