SatAndLight
2.2.2-hubble
Simulation toolkit for space telescopes
|
#include "CUtils.h"
Functions | |
string | GetDirectoryFromFilePath (const string aFilePath) |
Returns the directory from the file path. More... | |
unsigned int | GetGcd (unsigned int aN1, unsigned int aN2) |
Returns the greater common divisor between 2 numbers. More... | |
vector< string > | Glob (const char *aPattern) |
C utility to extract a list of files from a given file pattern. More... | |
bool | IsDirectory (const string aDirPath) |
Checks if a directory exists. More... | |
bool | IsFile (const string aFileName) |
Checks if a file exists. More... | |
string | ReplaceAll (string aStr, const string &aFrom, const string &aTo) |
Replaces all occurences of a sub-string by another sub-string. More... | |
vector< string > | SplitString (const string aStringToSplit, const char aSeparator) |
Splits a string. More... | |
See CUtils.h.
string GetDirectoryFromFilePath | ( | const string | aFilePath | ) |
Returns the directory from the file path.
[in] | aFilePath | File path. |
unsigned int GetGcd | ( | unsigned int | aN1, |
unsigned int | aN2 | ||
) |
Returns the greater common divisor between 2 numbers.
[in] | aN1 | First number. |
[in] | aN2 | Second number. |
vector<string> Glob | ( | const char * | aPattern | ) |
C utility to extract a list of files from a given file pattern.
[in] | aPattern | File pattern to match. |
bool IsDirectory | ( | const string | aDirPath | ) |
Checks if a directory exists.
[in] | aDirPath | Path to the directory to test. |
bool IsFile | ( | const string | aFileName | ) |
Checks if a file exists.
[in] | aFileName | Path to the file to test. |
string ReplaceAll | ( | string | aStr, |
const string & | aFrom, | ||
const string & | aTo | ||
) |
Replaces all occurences of a sub-string by another sub-string.
All occurences of sub-string 'aFrom' are replaced by 'aTo'.
aStr | String to modify. |
aFrom | Substring to replace from. |
aTo | Substring to replace to. |
vector<string> SplitString | ( | const string | aStringToSplit, |
const char | aSeparator | ||
) |
Splits a string.
A string is divided into a vector of sub-strings. The separator defines where to break the input string. The separator must be a single character.
[in] | aStringToSplit | String to divide. |
[in] | aSeparator | Separator. |