My Project
|
Implementation of helper functions. More...
#include "MyTools.h"
Functions | |
bool | openFile (ifstream *fin, string filename) |
const std::string | trim (const std::string &pString, const std::string &pWhitespace) |
bool | fline_tr (ifstream *fin, vector< string > *fields, string delim) |
map< string, vector< string > > | getParameters (int argc, char **input) |
int | lineCount (string filename) |
Implementation of helper functions.
map< string, vector< string > > getParameters | ( | int | argc, |
char ** | input | ||
) |
Return a list of parameter names and values from a string. The names can be preceeded by nothing, a '-' or a '--'. The value then follows an '='. Values that may contain nested flags should be surrounded by single quotes (').
argc | number of elements in input |
input | array of strings to parse for flags and arguments |
int lineCount | ( | string | filename | ) |
Count the number of lines in a given file
filename | File to count lines of |
bool openFile | ( | ifstream * | fin, |
string | filename | ||
) |
Open an ifstream with some basic checks
fin | ifstream to use to open file |
filename | file to open |
const std::string trim | ( | const std::string & | pString, |
const std::string & | pWhitespace | ||
) |
Remove beginning and trailing "whitespace" from the string
pString | String to trim |
pWhitespace | Characters to trim at the ends of the given strings. |