All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Typedefs | Functions
openfluid::tools Namespace Reference

Classes

class  ChronFileInterpolator
class  ChronFileLinearInterpolator
class  ChronologicalSerie
class  ColumnTextParser
class  ReaderNextValue
class  DistributionBindings
class  DistributionTables
class  ExternalProgram
class  FileDownloader
struct  GDALDriverInfos_t
class  ProgressiveChronFileReader
class  ProgressiveColumnFileReader

Typedefs

typedef std::pair
< openfluid::core::DateTime,
double > 
ChronItem_t
typedef std::map< std::string,
GDALDriverInfos_t
GDALDriversFilesExts_t

Functions

const GDALDriversFilesExts_t
DLLEXPORT 
getOGRFilesDriversForOpenFLUID ()
const GDALDriversFilesExts_t
DLLEXPORT 
getGDALFilesDriversForOpenFLUID ()
QString DLLEXPORT toIniCompatible (const std::string &Str)
std::string DLLEXPORT fromIniCompatible (const QVariant &Var)
std::list< std::string > DLLEXPORT toStdStringList (const QStringList &StrList)
QString DLLEXPORT getOGRGDALFormatsForQFileDialogs (const GDALDriversFilesExts_t &Drivers, const QString &AllFormatsLabel)
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 
GetFilesBySuffixAndExt (const std::string &DirToExplore, const std::string &Suffix, 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::vector< std::string >
DLLEXPORT 
getFilesRecursively (const std::string &DirPath)
std::string DLLEXPORT ReplaceEmptyString (std::string SourceStr, const std::string &ReplaceStr)
std::string DLLEXPORT RemoveTrailingSlashes (std::string Str)
void DLLEXPORT printSTDOUT (std::vector< std::string > Strings, std::string Sep)
void DLLEXPORT CopyDirectoryRecursively (const std::string SourcePath, const std::string IntoPath, const bool DontCopyDotDirs=false)
void DLLEXPORT CopyDirectoryContentsRecursively (const std::string SourcePath, const std::string IntoPath, const bool DontCopyDotDirs=false)
int DLLEXPORT CompareVersions (const std::string &VersionA, const std::string &VersionB, bool Strict=true)
void DLLEXPORT Sleep (const unsigned int MSec)

Typedef Documentation


Function Documentation

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

Compare two 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::CopyDirectoryContentsRecursively ( const std::string  SourcePath,
const std::string  IntoPath,
const bool  DontCopyDotDirs = false 
)
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)
std::string DLLEXPORT openfluid::tools::fromIniCompatible ( const QVariant &  Var)
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::vector<std::string> DLLEXPORT openfluid::tools::GetFilesBySuffixAndExt ( const std::string &  DirToExplore,
const std::string &  Suffix,
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::vector<std::string> DLLEXPORT openfluid::tools::getFilesRecursively ( const std::string &  DirPath)

Store all the paths of the files existing in dir passed as parameter

QString DLLEXPORT openfluid::tools::getOGRGDALFormatsForQFileDialogs ( const GDALDriversFilesExts_t &  Drivers,
const QString &  AllFormatsLabel 
)

Returns the available GDAL/OGR formats as a QFileDialog formats string. The string is built according to GDAL/OGR available drivers. The OGRRegisterAll() and/or GDALAllRegister() instruction must be called before using this function.

Parameters:
[in]AllFormatsLabelthe label displayed for all formats
Returns:
the format string (e.g. "All vector files (*.shp *.mif *.tab);;ESRI Shapefiles (*.shp);;Mapinfo (*.mif *.tab)")
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.parashift.com/c++-faq-lite/floating-point-arith.html
http://www.boost.org/doc/libs/1_38_0/libs/test/doc/html/utf/testing-tools/floating_point_comparison.html
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.parashift.com/c++-faq-lite/floating-point-arith.html
http://www.boost.org/doc/libs/1_38_0/libs/test/doc/html/utf/testing-tools/floating_point_comparison.html
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 
)
void DLLEXPORT openfluid::tools::Sleep ( const unsigned int  MSec)
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
QString DLLEXPORT openfluid::tools::toIniCompatible ( const std::string &  Str)
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
std::list<std::string> DLLEXPORT openfluid::tools::toStdStringList ( const QStringList &  StrList)
bool DLLEXPORT openfluid::tools::WildcardMatching ( const std::string  Pattern,
const std::string  Str 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines