#include <string>
#include <vector>
#include <cstdlib>
#include <fstream>
#include <sstream>
#include <iostream>
Go to the source code of this file.
|
| void | print_exit (const char *msg) |
| | prints a message before quitting the program More...
|
| |
| void | strip_string (std::string &s) |
| | removes white space at the beginning and end of a string More...
|
| |
| void | split_string (char c, std::string &s, std::string &s1, std::string &s2) |
| | splits a string on the first instance of a specified character More...
|
| |
|
std::string | int_to_string (long i) |
| | converts an integer into a string
|
| |
|
void | check_file_write (const char *fn) |
| | checks if a file can be written to
|
| |
| template<class T > |
| void | write_array (const char *fn, T *a, long size) |
| | writes an array to a binary file More...
|
| |
| template<class T > |
| void | write_array (const std::string &fn, T *a, long size) |
| | writes an array to a binary file More...
|
| |
| template<class T > |
| void | write_array (const char *fn, std::vector< T > a) |
| | writes an array to a binary file More...
|
| |
| template<class T > |
| void | write_array (const std::string &fn, std::vector< T > a) |
| | writes an array to a binary file More...
|
| |
| void | check_file_read (const char *fn) |
| | checks if a file can be opened for reading More...
|
| |
| std::vector< std::vector< std::string > > | read_values (const char *fn) |
| | reads a settings file into a vector of vectors of strings More...
|
| |
◆ check_file_read()
| void check_file_read |
( |
const char * |
fn | ) |
|
checks if a file can be opened for reading
- Parameters
-
| [in] | fn | path to file to check |
Definition at line 62 of file io.cc.
◆ print_exit()
| void print_exit |
( |
const char * |
msg | ) |
|
prints a message before quitting the program
- Parameters
-
| [in] | msg | a string to print before exiting |
Definition at line 5 of file io.cc.
◆ read_values()
| std::vector< std::vector< std::string > > read_values |
( |
const char * |
fn | ) |
|
reads a settings file into a vector of vectors of strings
- Parameters
-
| [in] | fn | path to settings file |
Definition at line 72 of file io.cc.
◆ split_string()
| void split_string |
( |
char |
c, |
|
|
std::string & |
s, |
|
|
std::string & |
s1, |
|
|
std::string & |
s2 |
|
) |
| |
splits a string on the first instance of a specified character
- Parameters
-
| [in] | c | character to split on |
| [in] | s | string to split |
| [out] | s1 | first part of split string |
| [out] | s2 | second part of split string |
Definition at line 27 of file io.cc.
◆ strip_string()
| void strip_string |
( |
std::string & |
s | ) |
|
removes white space at the beginning and end of a string
- Parameters
-
| [in] | s | string to strip of white space |
Definition at line 16 of file io.cc.
◆ write_array() [1/4]
template<class T >
| void write_array |
( |
const char * |
fn, |
|
|
std::vector< T > |
a |
|
) |
| |
writes an array to a binary file
- Parameters
-
| [in] | fn | target file path |
| [in] | a | vector of numbers to write |
Definition at line 78 of file io.h.
◆ write_array() [2/4]
template<class T >
| void write_array |
( |
const char * |
fn, |
|
|
T * |
a, |
|
|
long |
size |
|
) |
| |
writes an array to a binary file
- Parameters
-
| [in] | fn | target file path |
| [in] | a | array of numbers to write |
| [in] | size | length of array |
Definition at line 53 of file io.h.
◆ write_array() [3/4]
template<class T >
| void write_array |
( |
const std::string & |
fn, |
|
|
std::vector< T > |
a |
|
) |
| |
writes an array to a binary file
- Parameters
-
| [in] | fn | target file path |
| [in] | a | vector of numbers to write |
Definition at line 88 of file io.h.
◆ write_array() [4/4]
template<class T >
| void write_array |
( |
const std::string & |
fn, |
|
|
T * |
a, |
|
|
long |
size |
|
) |
| |
writes an array to a binary file
- Parameters
-
| [in] | fn | target file path |
| [in] | a | array of numbers to write |
| [in] | size | length of array |
Definition at line 68 of file io.h.