37std::vector<std::string>
split(std::string
const& input,
38 char delimiter =
' ');
46std::string
trim(std::string
const& line,
47 std::string
const& whitespace =
" \t");
58std::string
reduce(std::string
const& line,
59 std::string
const& whitespace =
" \t",
60 std::string
const& fill =
" ");
71std::string
pad(std::string
const& input,
77std::string
strpr(
const char* format, ...);
90 std::vector<std::string>
const& title,
91 std::vector<std::size_t>
const& colLength,
92 std::vector<std::string>
const& colName,
93 std::vector<std::string>
const& colInfo,
94 char const& commentChar =
'#');
103 std::vector<std::string>
const lines);
112 std::vector<std::string>
const lines);
124 std::string fileName,
125 std::vector<std::size_t> columns,
134template<
typename K,
typename V>
137 std::map<K, V>::key_type
const& key)
139 if (stdMap.find(key) == stdMap.end())
141 std::stringstream message;
142 message <<
"ERROR: No map entry found for key \"";
145 throw std::range_error(message.str());
147 return stdMap.find(key)->second;
160 return ((*lhs) < (*rhs));
170double pow_int(
double x,
int n);
string pad(string const &input, size_t num, char fill, bool right)
string strpr(const char *format,...)
String version of printf function.
vector< string > createFileHeader(vector< string > const &title, vector< size_t > const &colSize, vector< string > const &colName, vector< string > const &colInfo, char const &commentChar)
string trim(string const &line, string const &whitespace)
Remove leading and trailing whitespaces from string.
vector< string > split(string const &input, char delimiter)
Split string at each delimiter.
map< size_t, vector< double > > readColumnsFromFile(string fileName, vector< size_t > columns, char comment)
string reduce(string const &line, string const &whitespace, string const &fill)
Replace multiple whitespaces with fill.
bool comparePointerTargets(T *lhs, T *rhs)
Compare pointer targets.
double pow_int(double x, int n)
Integer version of power function, "fast exponentiation algorithm".
void appendLinesToFile(ofstream &file, vector< string > const lines)
Append multiple lines of strings to open file stream.
V const & safeFind(std::map< K, V > const &stdMap, typename std::map< K, V >::key_type const &key)
Safely access map entry.