Documentation for OpenFLUID
2.2.0
|
Classes | |
class | ChronFileInterpolator |
class | ChronFileLinearInterpolator |
class | ChronologicalSerie |
class | ColumnTextParser |
class | Console |
class | ReaderNextValue |
class | GenericDistributionBindings |
class | DistributionBindings |
class | MulticolDistributionBindings |
class | DistributionTables |
class | FileLogger |
class | Filesystem |
class | FilesystemPath |
class | ProgressiveChronFileReader |
class | ProgressiveColumnFileReader |
class | RandomNumberGenerator |
Class for management of random. It includes distribution utility functions. More... | |
class | SettingValue |
class | SettingsBackend |
class | TemplateProcessor |
class | Timer |
struct | UnitVarPair |
struct | ClassIDVar |
struct | ClassIDVarPrecision |
Typedefs | |
template<typename DataType = double> | |
using | ChronItem_t = std::pair< openfluid::core::DateTime, DataType > |
using | Path = FilesystemPath |
typedef std::vector< UnitVarPair > | UnitVarPairs_t |
typedef std::vector< ClassIDVar > | UnitVarTriplets_t |
Functions | |
template<typename T > | |
bool | convertString (const std::string &StrToConvert, T *Converted) |
template<typename T > | |
T | convertString (const std::string &StrToConvert) |
template<typename T > | |
bool | convertValue (const T &ValueToConvert, std::string *StrConverted) |
template<typename T > | |
std::string | convertValue (const T &ValueToConvert) |
void OPENFLUID_API | tokenizeString (const std::string &StrToTokenize, std::vector< std::string > &Tokens, const std::string &Delimiters) |
std::vector< std::string > OPENFLUID_API | splitString (const std::string &StrToSplit, const std::string &Separators, bool ReturnsEmpty=false) |
std::vector< std::string > OPENFLUID_API | splitString (const std::string &StrToSplit, char Separator, bool ReturnsEmpty=false) |
void OPENFLUID_API | stringReplace (std::string &Data, const std::string &ToSearch, const std::string &ReplaceStr) |
std::vector< openfluid::tools::ClassIDVar > | stringArrayToClassIDVarList (const std::vector< std::string > &StringArray, bool RemoveFirst=false) |
std::vector< openfluid::tools::ClassIDVar > | stringSelectionToClassIDVarList (const std::string &SelectionStr, bool RemoveFirst=false) |
constexpr auto | DatasetNameRuleString ("[A-Za-z0-9]+([A-Za-z0-9_\\.\\-]*)") |
constexpr auto | WareIDRuleString ("[A-Za-z0-9]+([A-Za-z0-9_\\.\\-]*)") |
constexpr auto | WareIDRuleStringAndTpl ("[A-Za-z0-9]+([A-Za-z0-9_@\\.\\-]*)") |
constexpr auto | FragmentNameRuleString ("[A-Za-z]+([A-Za-z0-9_\\.\\-]*)") |
constexpr auto | VariableNameRuleString ("[A-Za-z]+([A-Za-z0-9_\\.\\-]*)") |
constexpr auto | UnitsClassNameRuleString ("^[^;:#]+$") |
std::string OPENFLUID_API | classIDToString (const openfluid::core::UnitsClass_t &Class, openfluid::core::UnitID_t ID) |
bool OPENFLUID_API | isValidAlphaNumName (const std::string &Name) |
bool OPENFLUID_API | isValidDatasetName (const std::string &Name) |
bool OPENFLUID_API | isValidWareID (const openfluid::ware::WareID_t &ID, bool Template=false) |
bool OPENFLUID_API | isValidUnitsClassName (const openfluid::core::UnitsClass_t &Name) |
bool OPENFLUID_API | isValidVariableName (const openfluid::core::VariableName_t &Name) |
std::string OPENFLUID_API | getVariableSelectionRegExp () |
bool OPENFLUID_API | isValidTypedVariableName (const openfluid::core::VariableName_t &Name) |
bool OPENFLUID_API | isValidAttributeName (const openfluid::core::AttributeName_t &Name) |
bool OPENFLUID_API | extractVariableNameAndType (const openfluid::core::VariableName_t &Name, openfluid::core::VariableName_t &VarName, openfluid::core::Value::Type &VarType) |
std::string OPENFLUID_API | buildGeneratorID (const openfluid::tools::UnitVarPairs_t &VarPairs, const std::string &StrDimType) |
bool OPENFLUID_API | matchWithWildcard (const std::string &Pattern, const std::string &Str) |
std::string OPENFLUID_API | replaceEmptyString (std::string SourceStr, const std::string &ReplaceStr) |
int OPENFLUID_API | compareVersions (const std::string &VersionA, const std::string &VersionB) |
int OPENFLUID_API | compareOpenFLUIDVersions (const std::string &VersionA, const std::string &VersionB, bool Strict=true) |
void OPENFLUID_API | millisleep (const unsigned long MSec) |
void OPENFLUID_API | microsleep (const unsigned long USec) |
std::string OPENFLUID_API | getNowAsString (const std::string &Format) |
std::string OPENFLUID_API | generatePseudoUniqueIdentifier (const unsigned int Length) |
std::string OPENFLUID_API | escapePattern (const std::string &Str) |
std::string OPENFLUID_API | escapeString (const std::string &Str) |
std::pair< int, int > OPENFLUID_API | fromGeometryString (const std::string &Str, const std::string &GeomInfo) |
std::string OPENFLUID_API | toGeometryString (const std::string &GeomInfo, int Value1, int Value2) |
std::string OPENFLUID_API | toLowerCase (const std::string &Str) |
std::string OPENFLUID_API | toUpperCase (const std::string &Str) |
std::string OPENFLUID_API | trimLeft (const std::string &Str) |
std::string OPENFLUID_API | trimRight (const std::string &Str) |
std::string OPENFLUID_API | trim (const std::string &Str) |
template<typename T > | |
bool | toNumeric (const std::string &Str, T &Num) |
template<typename T > | |
T | toNumeric (const std::string &Str) |
bool OPENFLUID_API | toBoolean (const std::string &Str) |
bool OPENFLUID_API | startsWith (const std::string &Str, const std::string &SubStr) |
bool OPENFLUID_API | endsWith (const std::string &Str, const std::string &SubStr) |
bool OPENFLUID_API | contains (const std::string &Str, const std::string &SubStr, bool CaseSensitive=true) |
std::string OPENFLUID_API | replace (const std::string &Str, const std::string &SearchStr, const std::string &ReplaceStr) |
template<class... A> | |
std::string | format (const std::string &Fmt, A &&...Args) |
std::vector< std::string > OPENFLUID_API | split (const std::string &Str, const char Sep, bool KeepEmpty=false) |
std::vector< std::string > OPENFLUID_API | split (const std::string &Str, const std::string &SepChars, bool KeepEmpty=false) |
std::string OPENFLUID_API | join (const std::vector< std::string > &Vect, const std::string &Sep) |
UnitVarTriplets_t OPENFLUID_API | deserializeVarTriplets (const std::string &Selection) |
UnitVarPairs_t OPENFLUID_API | deduceVarPairs (const UnitVarTriplets_t &Triplets) |
std::string OPENFLUID_API | serializeVarTriplets (const UnitVarTriplets_t &Triplets) |
Variables | |
static std::error_code | DefaultErrorCode |
using openfluid::tools::ChronItem_t = typedef std::pair<openfluid::core::DateTime,DataType> |
using openfluid::tools::Path = typedef FilesystemPath |
Alias for the openfluid::tools::FilesystemPath class
typedef std::vector<UnitVarPair> openfluid::tools::UnitVarPairs_t |
typedef std::vector<ClassIDVar> openfluid::tools::UnitVarTriplets_t |
std::string OPENFLUID_API openfluid::tools::buildGeneratorID | ( | const openfluid::tools::UnitVarPairs_t & | VarPairs, |
const std::string & | StrDimType | ||
) |
Builds a generator ID
[in] | VarPairs | Pair of unit classes/variables to create the generator ID |
[in] | StrDimType | Dimension type of generator |
std::string OPENFLUID_API openfluid::tools::classIDToString | ( | const openfluid::core::UnitsClass_t & | Class, |
openfluid::core::UnitID_t | ID | ||
) |
Generates string from class and ID of a spatial unit using the "Class#ID" pattern.
[in] | Class | The units class |
[in] | ID | The unit ID |
int OPENFLUID_API openfluid::tools::compareOpenFLUIDVersions | ( | const std::string & | VersionA, |
const std::string & | VersionB, | ||
bool | Strict = true |
||
) |
Compares two OpenFLUID software versions. Version number must be formed as major.minor.patch[~status]
[in] | VersionA | the first version number |
[in] | VersionB | the second version number |
[in] | Strict | If true, the comparison include the status part of the version (it ignores it otherwise) |
int OPENFLUID_API openfluid::tools::compareVersions | ( | const std::string & | VersionA, |
const std::string & | VersionB | ||
) |
Compares two OpenFLUID software versions. Only numeric numbers are accepted (no alphabetic character)
[in] | VersionA | the first version number |
[in] | VersionB | the second version number |
bool OPENFLUID_API openfluid::tools::contains | ( | const std::string & | Str, |
const std::string & | SubStr, | ||
bool | CaseSensitive = true |
||
) |
Checks if a string contains a given substring
[in] | Str | the string to check |
[in] | SubStr | the substring |
[in] | CaseSensitive | true for case sensitive |
|
inline |
Converts a string to another type
[in] | StrToConvert | the string to convert |
openfluid::base::FrameworkException | Error in string conversion |
|
inline |
Converts a string to another type
[in] | StrToConvert | the string to convert |
[out] | Converted | the result of the conversion |
|
inline |
Converts a value to a string
[in] | ValueToConvert | the value to convert |
openfluid::base::FrameworkException | Error in value conversion |
|
inline |
Converts a value to a string
[in] | ValueToConvert | the value to convert |
[out] | StrConverted | the result of the conversion |
|
constexpr |
UnitVarPairs_t OPENFLUID_API openfluid::tools::deduceVarPairs | ( | const UnitVarTriplets_t & | Triplets | ) |
UnitVarTriplets_t OPENFLUID_API openfluid::tools::deserializeVarTriplets | ( | const std::string & | Selection | ) |
bool OPENFLUID_API openfluid::tools::endsWith | ( | const std::string & | Str, |
const std::string & | SubStr | ||
) |
Checks if a string ends with a given substring
[in] | Str | the string to check |
[in] | SubStr | the substring |
std::string OPENFLUID_API openfluid::tools::escapePattern | ( | const std::string & | Str | ) |
Returns the given regex pattern string with special chars that are escaped
[in] | Str | the regex pattern |
std::string OPENFLUID_API openfluid::tools::escapeString | ( | const std::string & | Str | ) |
Returns the given string with special chars that are escaped
[in] | Str | the string |
bool OPENFLUID_API openfluid::tools::extractVariableNameAndType | ( | const openfluid::core::VariableName_t & | Name, |
openfluid::core::VariableName_t & | VarName, | ||
openfluid::core::Value::Type & | VarType | ||
) |
Checks and extracts variable name and type from a full variable name (with or without type).
To be valid, a variable name must only contain alphanumeric, '_', '-' or '.' characters, must begin by an alphanumeric character, and can be suffixed by a valid type into square brackets.
[in] | Name | the variable name to process |
[out] | VarName | the extracted variable name |
[out] | VarType | the extracted variable type |
|
inline |
Formats a string using a format and a variable number of arguments.
As it is based on the C snprintf functions, it uses the same format specification, and has the same limitations in usable types, performance and error handling
[in] | Fmt | The format string using POSIX format style |
[in] | Args | The variadic list of arguments to format |
|
constexpr |
std::pair<int,int> OPENFLUID_API openfluid::tools::fromGeometryString | ( | const std::string & | Str, |
const std::string & | GeomInfo | ||
) |
Returns a pair of integer values extracted from a geometry string
[in] | Str | the geometry string (e.g. "@Point(127 82)", "@Size(1024 768)") |
[in] | GeomInfo | the expected geometry information type (e.g. "Point", "Size") |
std::string OPENFLUID_API openfluid::tools::generatePseudoUniqueIdentifier | ( | const unsigned int | Length | ) |
Generates a pseudo-unique identifier using alphanumeric characters and Mersenne Twister random engine.
[in] | Length | the length of the identifier to generate |
std::string OPENFLUID_API openfluid::tools::getNowAsString | ( | const std::string & | Format | ) |
Returns the current date and time as a formatted string
[in] | Format | an strftime()-like format string |
std::string OPENFLUID_API openfluid::tools::getVariableSelectionRegExp | ( | ) |
Checks whether a variable sequence (without type) is valid or not.
To be valid, a sequence must contain triplets of variable separated by ';'
bool OPENFLUID_API openfluid::tools::isValidAlphaNumName | ( | const std::string & | Name | ) |
Checks whether an alphanumeric name is valid or not.
To be valid, a name must only contain alphanumeric characters.
[in] | Name | the name to check |
bool OPENFLUID_API openfluid::tools::isValidAttributeName | ( | const openfluid::core::AttributeName_t & | Name | ) |
Checks whether an attribute name is valid or not.
To be valid, an attribute name must only contain alphanumeric, '_', '-' or '.' characters, and must begin by an alphanumeric character.
[in] | Name | the attribute name to check |
bool OPENFLUID_API openfluid::tools::isValidDatasetName | ( | const std::string & | Name | ) |
Checks whether a dataset or project name is valid or not.
To be valid, a name must only contain alphanumeric, '_', '-', '.' characters, and must begin by an alphanumeric character.
[in] | Name | the name to check |
bool OPENFLUID_API openfluid::tools::isValidTypedVariableName | ( | const openfluid::core::VariableName_t & | Name | ) |
Checks whether a variable name (with or without type) is valid or not.
To be valid, a variable name must only contain alphanumeric, '_', '-' or '.' characters, must begin by an alphanumeric character, and can be suffixed by a valid type into square brackets.
[in] | Name | the variable name to check |
bool OPENFLUID_API openfluid::tools::isValidUnitsClassName | ( | const openfluid::core::UnitsClass_t & | Name | ) |
Checks whether a units classe name is valid or not.
To be valid, a units class name must not contain any of ';', ':' and '#' characters,
[in] | Name | the units class name to check |
bool OPENFLUID_API openfluid::tools::isValidVariableName | ( | const openfluid::core::VariableName_t & | Name | ) |
Checks whether a variable name (without type) is valid or not.
To be valid, a variable name must only contain alphanumeric, '_', '-' or '.' characters, and must begin by an alphanumeric character.
[in] | Name | the variable name to check |
bool OPENFLUID_API openfluid::tools::isValidWareID | ( | const openfluid::ware::WareID_t & | ID, |
bool | Template = false |
||
) |
Checks whether a ware ID is valid or not.
To be valid, a ware ID must only contain alphanumeric, '_', '-', '.' characters, and must begin by an alphanumeric character.
[in] | ID | the ware ID to check |
[in] | Template | True to enable a template on the ware ID |
std::string OPENFLUID_API openfluid::tools::join | ( | const std::vector< std::string > & | Vect, |
const std::string & | Sep | ||
) |
Joins a vector of strings into a string using a separator
[in] | Vect | the vector of strings to join |
[in] | Sep | the string used as separator |
bool OPENFLUID_API openfluid::tools::matchWithWildcard | ( | const std::string & | Pattern, |
const std::string & | Str | ||
) |
Checks if the given string matches the given pattern, including * and ? wildcards
[in] | Pattern | The pattern to match |
[in] | Str | The string to test |
void OPENFLUID_API openfluid::tools::microsleep | ( | const unsigned long | USec | ) |
Suspend execution of current thread for microseconds
[in] | USec | the microseconds interval |
void OPENFLUID_API openfluid::tools::millisleep | ( | const unsigned long | MSec | ) |
Suspends execution of current thread for milliseconds
[in] | MSec | the milliseconds interval |
std::string OPENFLUID_API openfluid::tools::replace | ( | const std::string & | Str, |
const std::string & | SearchStr, | ||
const std::string & | ReplaceStr | ||
) |
Replaces every occurrence in a string of a searched substring by a replacement substring
[in] | Str | the original string |
[in] | SearchStr | the searched substring |
[in] | ReplaceStr | the replacement substring |
std::string OPENFLUID_API openfluid::tools::replaceEmptyString | ( | std::string | SourceStr, |
const std::string & | ReplaceStr | ||
) |
Replaces a string by another string if it is empty
[in] | SourceStr | the source string to process |
[in] | ReplaceStr | the replacement string to use |
std::string OPENFLUID_API openfluid::tools::serializeVarTriplets | ( | const UnitVarTriplets_t & | Triplets | ) |
std::vector<std::string> OPENFLUID_API openfluid::tools::split | ( | const std::string & | Str, |
const char | Sep, | ||
bool | KeepEmpty = false |
||
) |
Splits a string into a vector of strings using a separator character
[in] | Str | the string to split |
[in] | Sep | the separator character used to split the string |
[in] | KeepEmpty | if true, empty strings are returned (disabled by default) |
std::vector<std::string> OPENFLUID_API openfluid::tools::split | ( | const std::string & | Str, |
const std::string & | SepChars, | ||
bool | KeepEmpty = false |
||
) |
Splits a string into a vector of strings using any character of the the string of separators
[in] | Str | the string to split |
[in] | SepChars | the string of separators used to split the string |
[in] | KeepEmpty | if true, empty strings are returned (disabled by default) |
std::vector<std::string> OPENFLUID_API openfluid::tools::splitString | ( | const std::string & | StrToSplit, |
char | Separator, | ||
bool | ReturnsEmpty = false |
||
) |
Splits the given string into a std::string array, split using the given SepString
[in] | StrToSplit | the string to split |
[in] | Separator | the separator character used to split the string |
[in] | ReturnsEmpty | if true, the empty strings are returned |
std::vector<std::string> OPENFLUID_API openfluid::tools::splitString | ( | const std::string & | StrToSplit, |
const std::string & | Separators, | ||
bool | ReturnsEmpty = false |
||
) |
Splits the given string into a std::string array, split using the given SepString
[in] | StrToSplit | the string to split |
[in] | Separators | the string of separators used to split the string |
[in] | ReturnsEmpty | if true, the empty strings are returned |
bool OPENFLUID_API openfluid::tools::startsWith | ( | const std::string & | Str, |
const std::string & | SubStr | ||
) |
Checks if a string starts with a given substring
[in] | Str | the string to check |
[in] | SubStr | the substring |
|
inline |
void OPENFLUID_API openfluid::tools::stringReplace | ( | std::string & | Data, |
const std::string & | ToSearch, | ||
const std::string & | ReplaceStr | ||
) |
Replace every occurrence of a given substring (target) in a string by wanted replacement substring
[in] | Data | the string to work on |
[in] | ToSearch | the target substring |
[in] | ReplaceStr | the replacement substring |
|
inline |
bool OPENFLUID_API openfluid::tools::toBoolean | ( | const std::string & | Str | ) |
Converts a string into a boolean.
[in] | Str | the string to convert |
openfluid::base::FrameworkException | Error during conversion |
std::string OPENFLUID_API openfluid::tools::toGeometryString | ( | const std::string & | GeomInfo, |
int | Value1, | ||
int | Value2 | ||
) |
Returns a geometry string from a geometry info type and a pair of integer values
[in] | GeomInfo | the geometry information type (e.g. "Point", "Size") |
[in] | Value1 | the first value |
[in] | Value2 | the second value |
void OPENFLUID_API 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
[in] | StrToTokenize | the string to tokenize |
[out] | Tokens | the resulting tokens |
[in] | Delimiters | the string delimiter |
std::string OPENFLUID_API openfluid::tools::toLowerCase | ( | const std::string & | Str | ) |
Converts a string to lower case
[in] | Str | the string to convert |
|
inline |
Converts a string into a numeric value.
Due to the poor performance of this generic method, it is preferable to use standard C++ typed methods such as std::stoi, std:stod and others to convert a string into numerical values
[in] | Str | the string to convert |
openfluid::base::FrameworkException | Error during conversion |
|
inline |
Converts a string into a numeric value.
Due to the poor performance of this generic method, it is preferable to use standard C++ typed methods such as std::stoi, std:stod and others to convert a string into numerical values
[in] | Str | the string to convert |
[out] | Num | the converted numerical value |
std::string OPENFLUID_API openfluid::tools::toUpperCase | ( | const std::string & | Str | ) |
Converts a string to upper case
[in] | Str | the string to convert |
std::string OPENFLUID_API openfluid::tools::trim | ( | const std::string & | Str | ) |
Trims all the whitespaces character located on both right and left sides of the string
[in] | Str | the string to trim |
std::string OPENFLUID_API openfluid::tools::trimLeft | ( | const std::string & | Str | ) |
Trims all the whitespaces character located on the left side of the string
[in] | Str | the string to trim |
std::string OPENFLUID_API openfluid::tools::trimRight | ( | const std::string & | Str | ) |
Trims all the whitespaces character located on the right side of the string
[in] | Str | the string to trim |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
static |