/afs/in2p3.fr/throng/virgo/virgoDev/SoftFlorent/GWOLLUM/v2r2/src/Utils/CUtils.cc File Reference

#include "CUtils.h"
Include dependency graph for CUtils.cc:

Functions

string GetFileName (const string filepath)
 Extract and return the file name from file path.
vector< string > Glob (const char *pattern)
 c utility to extract a list of files.
bool IsBinaryFile (const char *filename)
 Check if a file exists and is a binary file.
bool IsDirectory (const char *dirname)
 Check if a directory exists.
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.
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.

Function Documentation

string GetFileName ( const string  filepath  ) 

Extract and return the file name from file path.

Parameters:
filepath file path
vector<string> Glob ( const char *  pattern  ) 

c utility to extract a list of files.

Returns a list of files matching a pattern.

Parameters:
pattern file pattern
bool IsBinaryFile ( const char *  filename  ) 

Check if a file exists and is a binary file.

Returns true if 'filename' is an existing binary file.

Parameters:
filename path to file to test
bool IsDirectory ( const char *  dirname  ) 

Check if a directory exists.

Returns true if 'dirname' is an existing directory.

Parameters:
dirname path to directory 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.

Parameters:
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

Parameters:
maindir path to main directory
double medianbiasfactor ( const int  nn  ) 

Returns the bias factor when computing a median with nn samples.

Parameters:
nn number of samples
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.

Parameters:
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.

Parameters:
stringtodivide string to divide
separator separator
string StringToUpper ( string  stringtoconvert  ) 

Convert a string to uppercase.

Parameters:
stringtoconvert string to convert
 All Classes Files Functions Variables Friends Defines

Generated on 29 Sep 2016 by  doxygen 1.6.1