[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/AetherModel/aethermodel.github.io/main/file__input_8h_source.html [Back]  [Original]

Aether: include/file_input.h Source File
Aether  0.0
Ionosphere-Thermosphere model
file_input.h
1 // Copyright 2020, the Aether Development Team (see doc/dev_team.md for members)
2 // Full license can be found in License.md
3 
4 #ifndef INCLUDE_FILE_INPUT_H_
5 #define INCLUDE_FILE_INPUT_H_
6 
7 /**************************************************************
8  * Functions that assist in the reading of files.
9  *
10  **************************************************************/
11 
12 #include <string>
13 #include <fstream>
14 #include <vector>
15 
16 /**************************************************************
17  \brief Reads the file until it finds a #command, returns "#command"
18  \param file_ptr file pointer to the open file
19  **/
20 std::string find_next_hash(std::ifstream &file_ptr);
21 
22 /**************************************************************
23  \brief Reads a series of line that can be in a CSV format, returns 2D array
24  \param file_ptr file pointer to the open file
25  **/
26 std::vector<std::vector<std::string>> read_csv(std::ifstream &file_ptr);
27 
28 /**************************************************************
29  \brief Reads a series of line that can be in a SSV format, returns 2D array
30  \param file_ptr file pointer to the open file
31  \param
32  **/
33 std::vector<std::vector<std::string>> read_ssv(std::ifstream &file_ptr);
34 
35 /**************************************************************
36  \brief Reads either a comma-separated time or series of lines describing time
37 
38  format is either
39  y, m, d, h, m, s, ms
40  or
41  y
42  m
43  d
44  h
45  m
46  s
47  ms
48 
49  \param file_ptr file pointer to the open file
50  \param
51  **/
52 std::vector<int> read_itime(std::ifstream &file_ptr, std::string hash);
53 
54 /**************************************************************
55  \brief Converts a string to lower case, returning lower case string
56  \param instring string to make lower
57  **/
58 std::string make_lower(std::string instring);
59 
60 /**************************************************************
61  \brief Strips everything including and after two spaces, returns stripped str
62  \param instring string to strip end off of
63  **/
64 std::string strip_string_end(std::string instring);
65 
66 /**************************************************************
67  \brief Takes all of the spaces out of the sting, returns stripped string
68  \param instring string to take spaces out of
69  **/
70 std::string strip_spaces(std::string instring);
71 
72 /**************************************************************
73  \brief read in a string from a file
74  \param file_ptr file pointer to the open file
75  \param hash string to print out if there is an error
76  **/
77 std::string read_string(std::ifstream &file_ptr, std::string hash);
78 
79 /**************************************************************
80  \brief read in an integer from a file
81  \param file_ptr file pointer to the open file
82  \param hash string to print out if there is an error
83  **/
84 int read_int(std::ifstream &file_ptr, std::string hash);
85 
86 /**************************************************************
87  \brief read in a float from a file
88  \param file_ptr file pointer to the open file
89  \param hash string to print out if there is an error
90  **/
91 precision_t read_float(std::ifstream &file_ptr, std::string hash);
92 
93 /**************************************************************
94  \brief take a string with comma-separated-values and parse into vector
95  \param line string containing comma separated values
96  **/
97 std::vector<std::string> parse_csv_row_into_vector(std::string line);
98 
99 #endif // INCLUDE_FILE_INPUT_H_
Generated by   doxygen [doxygen] 1.8.17
Web Proxy Viewer  |  New URL  |  Original Page