#include <iostream>#include <iomanip>#include <math.h>#include <stdlib.h>#include <string.h>#include <vector>#include <stdio.h>#include <sstream>#include <fstream>#include <regex.h>#include <dirent.h>#include <glob.h>#include <fnmatch.h>

Go to the source code of this file.
Defines | |
| #define | LN10 2.30258509299404590109361379290930926799774169921875 |
| log(10) | |
| #define | LN2 0.6931471805599453094172321214581766 |
| log_e 2 | |
Functions | |
| string | GetFileName (const string filepath) |
| Extract and return the file name from file path. | |
| string | GetFileNameFromPath (const string filepathname) |
| Returns the file name given the file path. | |
| vector< string > | Glob (const char *pattern) |
| c utility to extract a list of files. | |
| bool | IsBinaryFile (const string filename) |
| Check if a file exists and is a binary file. | |
| bool | IsBinaryFile (const char *filename) |
| Check if a file exists and is a binary file. | |
| bool | IsDirectory (const string dirname) |
| Check if a directory exists. | |
| bool | IsDirectory (const char *dirname) |
| Check if a directory exists. | |
| bool | IsPowerOfTwo (unsigned int x) |
| Is this integer a power of 2. | |
| bool | IsTextFile (const string filename) |
| Check if a file exists and is a txt file. | |
| bool | IsTextFile (const char *filename) |
| Check if a file exists and is a txt file. | |
| bool | ListDirectories (const string maindir, vector< string > &subdir) |
| Returns list of subdirectories. | |
| double | medianbiasfactor (const int nn) |
| Returns the bias factor when computing a median with nn samples. | |
| int | NextPowerOfTwo (double x) |
| Returns the next power of 2. | |
| string | ReplaceAll (string str, const string &from, const string &to) |
| Replace all occurences of a sub-string. | |
| vector< string > | SplitString (const string stringtodivide, const char separator) |
| Splits a string. | |
| string | StringToUpper (string stringtoconvert) |
| Convert a string to uppercase. | |
| #define LN10 2.30258509299404590109361379290930926799774169921875 |
log(10)
| #define LN2 0.6931471805599453094172321214581766 |
log_e 2
| string GetFileName | ( | const string | filepath | ) |
Extract and return the file name from file path.
| filepath | file path |
| string GetFileNameFromPath | ( | const string | filepathname | ) | [inline] |
Returns the file name given the file path.
For example "myprog.exe" is returned from:
| filepathname | file path |
| vector<string> Glob | ( | const char * | pattern | ) |
c utility to extract a list of files.
Returns a list of files matching a pattern.
| pattern | file pattern |
| bool IsBinaryFile | ( | const string | filename | ) | [inline] |
Check if a file exists and is a binary file.
Returns true if 'filename' is an existing binary file.
| filename | path to file to test |
| bool IsBinaryFile | ( | const char * | filename | ) |
Check if a file exists and is a binary file.
Returns true if 'filename' is an existing binary file.
| filename | path to file to test |
| bool IsDirectory | ( | const string | dirname | ) | [inline] |
Check if a directory exists.
Returns true if 'dirname' is an existing directory.
| dirname | path to directory to test |
| bool IsDirectory | ( | const char * | dirname | ) |
Check if a directory exists.
Returns true if 'dirname' is an existing directory.
| dirname | path to directory to test |
| bool IsPowerOfTwo | ( | unsigned int | x | ) | [inline] |
Is this integer a power of 2.
true is returned if this is the case.
| x | integer to test. |
| bool IsTextFile | ( | const string | filename | ) | [inline] |
Check if a file exists and is a txt file.
Returns true if 'filename' is an existing text file.
| filename | path to file to test |
| bool IsTextFile | ( | const char * | filename | ) |
Check if a file exists and is a txt file.
Returns true if 'filename' is an existing text file.
| filename | path to file to test |
| bool ListDirectories | ( | const string | maindir, | |
| vector< string > & | subdir | |||
| ) |
Returns list of subdirectories.
The vector 'subdir' is filled with directories contained in 'maindir' Returns true if success
| maindir | path to main directory |
| double medianbiasfactor | ( | const int | nn | ) |
Returns the bias factor when computing a median with nn samples.
| nn | number of samples |
| int NextPowerOfTwo | ( | double | x | ) | [inline] |
Returns the next power of 2.
| x | to get the next power of 2 of |
| string ReplaceAll | ( | string | str, | |
| const string & | from, | |||
| const string & | to | |||
| ) |
Replace all occurences of a sub-string.
All occurences of substring 'from' are replaced by 'to'. The modified string is returned.
| str | string to modify | |
| from | substring to replace from | |
| from | substring to replace to |
| vector<string> SplitString | ( | const string | stringtodivide, | |
| const char | separator | |||
| ) |
Splits a string.
A string is divided into an array of words. The separator defines where to break the string. The separator should be a single character. A vector of string is returned.
| stringtodivide | string to divide | |
| separator | separator |
| string StringToUpper | ( | string | stringtoconvert | ) |
Convert a string to uppercase.
| stringtoconvert | string to convert |
1.6.1