Classes | Typedefs | Enumerations | Functions

openfluid::tools Namespace Reference

Classes

class  ColumnTextParser
class  CURLDownloader
class  DataSourcesFile
class  DistributeInterpolate
struct  TimePair
struct  IndexedSerie
class  DateTimeSerie

Typedefs

typedef std::map< int,
std::string > 
IDDataSourcesMap
typedef std::map< int,
DateTimeSerie * > 
DTSeriesMap
typedef std::map< int,
DateTimeSerie * > 
UnitsDTSeriesMap
typedef std::map< int,
IndexedSerie * > 
IndexedSeriesMap
typedef std::map< int,
IndexedSerie * > 
UnitsIndexedSeriesMap

Enumerations

enum  SeriePreprocess { SERIEPREPCS_NONE, SERIEPREPCS_CUMULATE }

Functions

template<typename T >
bool ConvertString (const std::string &StrToConvert, T *Converted)
template<typename T >
bool ConvertValue (const T ValueToConvert, std::string *StrConverted)
void DLLEXPORT TokenizeString (const std::string &StrToTokenize, std::vector< std::string > &Tokens, const std::string &Delimiters)
bool IsCloseEnough (double A, double B, double Epsilon=0.00001)
bool IsVeryClose (double A, double B, double Epsilon=0.00001)
bool DLLEXPORT WildcardMatching (const std::string Pattern, const std::string Str)
std::vector< std::string >
DLLEXPORT 
GetFilesByExt (const std::string DirToExplore, const std::string Ext, bool WithPath=false, bool ExtIncludeDot=false)
std::vector< std::string >
DLLEXPORT 
SplitString (const std::string StrToSplit, const std::string Separators, bool ReturnsEmpty=false)
bool DLLEXPORT EmptyDirectoryRecursively (const std::string DirPath)
std::string DLLEXPORT ReplaceEmptyString (std::string SourceStr, const std::string &ReplaceStr)
bool DLLEXPORT IsVectorNamedVariable (std::string Name)
std::string DLLEXPORT GetVectorNamedVariableName (std::string Name)
std::string DLLEXPORT RemoveTrailingSlashes (std::string Str)
void DLLEXPORT printSTDOUT (std::vector< std::string > Strings, std::string Sep)
openfluid::core::DateTime DLLEXPORT GenerateDateTimeFromStep (openfluid::core::DateTime DT0, openfluid::core::TimeStep_t TS, unsigned int CurrentStep)
void DLLEXPORT CopyDirectoryRecursively (const std::string SourcePath, const std::string IntoPath, const bool DontCopyDotDirs=false)
std::vector< std::string >
DLLEXPORT 
GetFileLocationsUsingPATHEnvVar (const std::string Filename)
int DLLEXPORT CompareVersions (const std::string &VersionA, const std::string &VersionB, bool Strict=true)
bool DLLEXPORT OpenURLInBrowser (const std::string &URL)

Typedef Documentation

typedef std::map<int,std::string> openfluid::tools::IDDataSourcesMap

Enumeration Type Documentation

Enumerator:
SERIEPREPCS_NONE 
SERIEPREPCS_CUMULATE 

Function Documentation

int DLLEXPORT openfluid::tools::CompareVersions ( const std::string &  VersionA,
const std::string &  VersionB,
bool  Strict = true 
)

Compare 2 OpenFLUID software versions. Version number must be formed as major.minor.patch[~status]

Parameters:
[in]VersionAthe first version number
[in]VersionBthe second version number
[in]StrictIf true, the comparison include the status part of the version (it ignores it otherwise)
Returns:
1 if VersionA is greater than VersionB, -1 if VersionB is greater than VersionA, 0 if versions are equals, -2 if a version format is not well-formed
template<typename T >
bool openfluid::tools::ConvertString ( const std::string &  StrToConvert,
T *  Converted 
) [inline]

Template function for string to other type conversion

Parameters:
[in]StrToConvertthe string to convert
[out]Convertedthe result of the conversion
Returns:
true if the conversion is correct
template<typename T >
bool openfluid::tools::ConvertValue ( const T  ValueToConvert,
std::string *  StrConverted 
) [inline]

Template function for value to string conversion

Parameters:
[in]ValueToConvertthe value to convert
[out]StrConvertedthe result of the conversion
Returns:
true if the conversion is correct
void DLLEXPORT openfluid::tools::CopyDirectoryRecursively ( const std::string  SourcePath,
const std::string  IntoPath,
const bool  DontCopyDotDirs = false 
)
bool DLLEXPORT openfluid::tools::EmptyDirectoryRecursively ( const std::string  DirPath)
openfluid::core::DateTime DLLEXPORT openfluid::tools::GenerateDateTimeFromStep ( openfluid::core::DateTime  DT0,
openfluid::core::TimeStep_t  TS,
unsigned int  CurrentStep 
)
std::vector<std::string> DLLEXPORT openfluid::tools::GetFileLocationsUsingPATHEnvVar ( const std::string  Filename)
std::vector<std::string> DLLEXPORT openfluid::tools::GetFilesByExt ( const std::string  DirToExplore,
const std::string  Ext,
bool  WithPath = false,
bool  ExtIncludeDot = false 
)

Get list of files with specified extension contained in the specified dir

Parameters:
[in]DirToExplorethe directory to explore
[in]Extthe file extension
[in]WithPathreturn full path with file name if true, file name only otherwise
[in]ExtIncludeDotif true, the given extension through Ext parameter is suffixed by a dot
std::string DLLEXPORT openfluid::tools::GetVectorNamedVariableName ( std::string  Name)
bool openfluid::tools::IsCloseEnough ( double  A,
double  B,
double  Epsilon = 0.00001 
) [inline]

Function for testing equality between two double precision floats, using the "close enough" method.

Parameters:
[in]Athe firts term of the equality
[in]Bthe firts term of the equality
[in]Epsilonthe comparison tolerance factor
See also:
http://www.ensta.fr/~diam/c++/online/c++-faq-lite/newbie.html#faq-29.17
http://www.boost.org/doc/libs/1_38_0/libs/test/doc/html/utf/testing-tools/floating_point_comparison.html
bool DLLEXPORT openfluid::tools::IsVectorNamedVariable ( std::string  Name)
bool openfluid::tools::IsVeryClose ( double  A,
double  B,
double  Epsilon = 0.00001 
) [inline]

Function for testing equality between two double precision floats, using the "very close" method.

Parameters:
[in]Athe firts term of the equality
[in]Bthe firts term of the equality
[in]Epsilonthe comparison tolerance factor
See also:
http://www.ensta.fr/~diam/c++/online/c++-faq-lite/newbie.html#faq-29.17
http://www.boost.org/doc/libs/1_38_0/libs/test/doc/html/utf/testing-tools/floating_point_comparison.html
bool DLLEXPORT openfluid::tools::OpenURLInBrowser ( const std::string &  URL)
void DLLEXPORT openfluid::tools::printSTDOUT ( std::vector< std::string >  Strings,
std::string  Sep 
)
std::string DLLEXPORT openfluid::tools::RemoveTrailingSlashes ( std::string  Str)
std::string DLLEXPORT openfluid::tools::ReplaceEmptyString ( std::string  SourceStr,
const std::string &  ReplaceStr 
)
std::vector<std::string> DLLEXPORT openfluid::tools::SplitString ( const std::string  StrToSplit,
const std::string  Separators,
bool  ReturnsEmpty = false 
)

Splits the passed string into a std::string array, split using the given SepString

Parameters:
[in]StrToSplitthe string to split
[in]Separatorsthe string of separators used to split the string
[in]ReturnsEmptyif true, the empty strings are returned
Returns:
a vector of strings
void DLLEXPORT openfluid::tools::TokenizeString ( const std::string &  StrToTokenize,
std::vector< std::string > &  Tokens,
const std::string &  Delimiters 
)

Function for tokenizing string into a vector of tokens

Parameters:
[in]StrToTokenizethe string to tokenize
[out]Tokensthe resulting tokens
[in]Delimitersthe string delimiter
bool DLLEXPORT openfluid::tools::WildcardMatching ( const std::string  Pattern,
const std::string  Str 
)

Generated using Doxygen 1.7.3
Creative Commons License Creative Commons By-NC-ND license