407 template <
typename _Tp>
411 return std::to_string(value);
485 res[i] =
ceps::readReal(file,errorMessage+
"("+std::to_string(i)+
"/"+std::to_string(n)+
")");
std::basic_string< CepsChar > CepsString
C++ format string.
std::array< _Type, _N > CepsArray
C++ arrays.
CepsScalar CepsMathScalar
Real numbers.
std::map< _Key, _Tp, _Compare, _Alloc > CepsMap
C++ map.
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
Eigen::Matrix< CepsScalar, 3, 3 > CepsMathTensor
Tensor, eigen format.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
float CepsReal
Need single precision floating point.
Eigen::Matrix< CepsScalar, 3, 1 > CepsMathVertex
Vertex, eigen format.
CepsArray3< CepsReal > CepsReal3D
Three real scalars, used like this for compatibility in polynomials.
int32_t CepsInt
Need 32 bit integer.
A namespace for all utility methods.
CepsString getDir(const CepsString &str)
Get a substring of s, from beginning of s to the last '/' character. Example: "/home/someone/file....
CepsVector< CepsString > cleanup(const CepsVector< CepsString > &vec)
Clean a vector of string, remove empty and " " string.
CepsMathTensor toMathTensor(const CepsVector< CepsString > &vec)
Cast a CepsVector of CepsString to CepsMathTensor.
CepsString toString(_Tp value)
Convert a given value to a string (input has to be compatible with std::to_string)
CepsString getFilename(const CepsString &str)
Returns a substring corresponding to the string after the last '/' character. Example: "/home/someone...
CepsString toKey(const CepsString &s)
Transform to key type a std::string, upper case and no spaces.
CepsBool endsWith(const CepsString &s, const CepsString &comp)
Check if the string 'str' ends with 'comp'.
CepsString join(const CepsVector< CepsString > &vec, const CepsChar &delimeter=' ')
Join multiple strings into one.
CepsSet< CepsInt > toInts(const CepsString &s)
Cast CepsString to a set of CepsInt.
CepsBool toBool(const CepsString &s)
Cast CepsString to CepsBool.
CepsMap< CepsString, CepsVector< CepsString > > splitByKeyword(const CepsString &s, const CepsSet< CepsString > &tags)
Extract parameters in the CepsString given by tags. Builds a map of keywords and parameter words acco...
CepsMathScalar toMathScalar(const CepsVector< CepsString > &vec)
Cast a CepsVector of CepsString to CepsMathScalar same effect as ceps::toReal(vec[0])
CepsSet< CepsUInt > toUInts(const CepsString &s)
Cast CepsString to a set of CepsUInt.
CepsString substract(const CepsString &s, const CepsString &toErase)
Substract all occurences of another CepsString.
void toKeyInPlace(CepsVector< CepsString > &vec)
Transform to key type a vector of std::string, upper case and no spaces.
CepsBool startsWith(const CepsString &s, const CepsString &comp)
Check if the string 'str' starts with 'comp'.
CepsArray< CepsMathScalar, n > readReals(std::istream &file, const CepsString &errorMessage="")
Reads n floating point numbers from an istream, aborts if conversion fails.
CepsSet< CepsReal > toReals(const CepsString &s)
Cast CepsString to a set of CepsReal.
CepsString toLower(const CepsString &s)
Switches all characters to lower case.
CepsString readParams(const CepsVector< CepsString > &scope, const CepsString &tag, const CepsString &def="", const CepsUInt &pad=1)
Read parameters into a map.
CepsBool startsWithOneOf(const CepsString &s, const CepsVector< CepsString > &comps)
Check if the string 'str' starts with one of 'comps'.
CepsString removeSpaces(const CepsString &s)
Removes spaces and tabs.
CepsReal3D readVertex(std::istream &file, const CepsString &errorMessage="")
Reads an integral number from an istream, aborts if conversion fails advances the stream by 1 word.
CepsInt readInt(std::istream &file, const CepsString &errorMessage="")
Reads an integral number from an istream, aborts if conversion fails advances the stream by 1 word.
CepsBool endsWithOneOf(const CepsString &s, const CepsVector< CepsString > &comps)
Check if the string 'str' ends with one of 'comps'.
CepsString getExtension(const CepsString &str)
Returns the extension of a file, if any.
CepsString removeDoubleSlashes(const CepsString &path)
Replaces double slashes in a string with a single slash. Used for clean paths.
CepsVector< CepsString > splitAtNthDelimiter(const CepsString &s, CepsUInt n, CepsString delimiters=CepsString(" \t"))
Split a string a the n-th delimeter. This ignores the doubled delimiter (eg multiple spaces count as ...
CepsVector< CepsString > split(const CepsString &s, const CepsString &delimiters=CepsString(" \t"))
Splits a string using mulitple delimiters in a single string.
CepsUInt toUInt(const CepsString &s)
Cast CepsString to CepsUInt.
CepsBool isSameFile(const CepsString &f1, const CepsString &f2)
Tells if given paths refer to the same file.
CepsInt toInt(const CepsString &s)
Cast CepsString to CepsInt.
CepsString toUpper(const CepsString &s)
Switches all characters to upper case.
CepsBool isNumber(const CepsString &s)
Check if the string contains only digit numbers.
CepsMathVertex toMathVertex(const CepsVector< CepsString > &vec)
Cast a CepsVector of CepsString to CepsMathVertex.
CepsVector< CepsString > splitUntilNthDelimiter(const CepsString &s, const CepsUInt &n, CepsString delimiters=CepsString(" \t"))
Split a string for the first n delimeters.
CepsString changeExtension(const CepsString &str, const CepsString &ext)
Change the extension of a file name (does not check if file exists).
CepsString getBaseName(const CepsString &str)
Extracts the base of a file name, without path, nor extension. Ex: getBaseName("/path/to/myfile....
CepsMathTensor readTensor(std::istream &file, const CepsString &errorMessage="")
Reads 9 floating point numbers from an istream, aborts if conversion fails advances the stream by 9 w...
CepsBool isPathInOneWord(const CepsString &s)
Checks if given path is in one word (it may not exist yet)
CepsString trim(const CepsString &s)
Removes trailing and preceeding spaces.
CepsBool fileExists(const CepsString &fileName, const CepsString &directory)
CepsReal toReal(const CepsString &s)
Cast CepsString to CepsReal.
CepsReal readReal(std::istream &file, const CepsString &errorMessage="")
Reads a floating point number from an istream, aborts if conversion fails advances the stream by 1 wo...