|
GEOS
|
Go to the source code of this file.
Namespaces | |
| geos | |
Functions | |
| string | geos::stringutilities::toLower (string const &input) |
| Return a copy of the string in lower case. More... | |
| template<typename IT , typename S = char> | |
| string | geos::stringutilities::join (IT first, IT last, S const &delim=S()) |
| Join strings or other printable objects with a delimiter. More... | |
| template<typename CONTAINER , typename S = char> | |
| string | geos::stringutilities::join (CONTAINER const &container, S const &delim=S()) |
| Join strings or other printable objects with a delimiter. More... | |
| template<typename IT , typename S , typename LAMBDA > | |
| string | geos::stringutilities::joinLambda (IT first, IT last, S const &delim, LAMBDA formattingFunc) |
| Join strings or other printable objects returned by a formatter functor. More... | |
| template<typename CONTAINER , typename S , typename LAMBDA > | |
| string | geos::stringutilities::joinLambda (CONTAINER const &container, S const &delim, LAMBDA formattingFunc) |
| Join strings or other printable objects returned by a formatter functor. More... | |
| template<typename S = char, typename T , typename ... Ts> | |
| string | geos::stringutilities::concat (S const &delim, T const &v, Ts const &... vs) |
| Concatenate variadic arguments into a string with a delimiter. More... | |
| template<template< class ... > class CONTAINER = stdVector> | |
| CONTAINER< string > | geos::stringutilities::tokenize (string_view str, string_view delimiters, bool const treatConsecutiveDelimAsOne=true, bool const preTrimStr=false) |
| Subdivide the string in substrings by the specified delimiters. More... | |
| template<template< class ... > class CONTAINER = stdVector> | |
| CONTAINER< string > | geos::stringutilities::tokenizeBySpaces (string_view str) |
| Subdivide the string in substrings by whitespaces separators (see std::isspace()). Do not create any empty substrings. More... | |
| string_view | geos::stringutilities::trim (string_view str, string_view charsToRemove) |
| Trim the string. More... | |
| string_view | geos::stringutilities::ltrimSpaces (string_view s) |
| Trim the left string. More... | |
| string_view | geos::stringutilities::trimSpaces (string_view str) |
| Trim the string so it does not starts nor ends with any whitespaces. More... | |
| string | geos::stringutilities::removeStringAndFollowingContent (string_view str, string_view strToRemove) |
| Search for a string in the line, and return the line truncated before the string. More... | |
| template<typename T > | |
| string | geos::stringutilities::addCommaSeparators (T const &num) |
| Add comma separators to an integral number for readability. More... | |
| template<typename STRING_T > | |
| stdVector< STRING_T > | geos::stringutilities::divideLines (size_t &linesWidth, string_view value) |
| Divides a string by newline characters and returns a vector of strings containing each line. Also calculates the width of the widest line. More... | |
| template<typename STRING_T > | |
| stdVector< STRING_T > | geos::stringutilities::wrapTextToMaxLength (stdVector< STRING_T > const &lines, size_t &maxLineLength) |
| Format all the lines by detecting spaces and by dividing each lines with maximum length specified. If a word has a greater size than maxLength, it will be cut in one or many parts. More... | |
| string | geos::stringutilities::wrapTextToMaxLength (string_view text, size_t maxLineLength) |
| Format all the lines by detecting spaces and by dividing each lines with maximum length specified. If a word has a greater size than maxLength, it will be cut in one or many parts. More... | |
| template<typename T > | |
| array1d< T > | geos::stringutilities::fromStringToArray (string const &str) |
| Take a string, and return a array1d with the cast values. More... | |
| template<typename T > | |
| string | geos::stringutilities::toMetricPrefixString (T const &value) |
| Take a numerical value and convert/scale it to a string with a metric prefix. i.e. Kilo, Mega, Giga, Tera, Peta, Exa. More... | |
| constexpr size_t | geos::stringutilities::cstrlen (char const *const str) |
| constexpr bool | geos::stringutilities::startsWith (std::string_view str, std::string_view prefix) |
| constexpr bool | geos::stringutilities::endsWith (std::string_view str, std::string_view suffix) |
| template<typename T > | |
| std::ostream & | geos::stringutilities::operator<< (std::ostream &os, std::optional< T > const &optValue) |
| Overloading operator (<<) for std::optional<T>. More... | |
| string geos::stringutilities::addCommaSeparators | ( | T const & | num | ) |
Add comma separators to an integral number for readability.
| T | the integral type of the number to format. |
| [in] | num | the integral number to format. |
| string geos::stringutilities::concat | ( | S const & | delim, |
| T const & | v, | ||
| Ts const &... | vs | ||
| ) |
Concatenate variadic arguments into a string with a delimiter.
| S | type of delimiter (printable to std::ostringstream) |
| T | type of first argument (printable to std::ostringstream) |
| Ts | types of remaining arguments (printable to std::ostringstream) |
| delim | delimiter |
| v | first value |
| vs | remaining values |
Definition at line 133 of file StringUtilities.hpp.
|
constexpr |
| str | The null-character terminated constant string |
Definition at line 317 of file StringUtilities.hpp.
| stdVector< STRING_T > geos::stringutilities::divideLines | ( | size_t & | linesWidth, |
| string_view | value | ||
| ) |
Divides a string by newline characters and returns a vector of strings containing each line. Also calculates the width of the widest line.
| linesWidth | [out] Reference to a size_t that will be set to the width of the widest line |
| value | The input string to divide into lines |
| STRING_T | The type of the string (string or string_view) |
|
constexpr |
| str | The string to compare |
| suffix | A suffix we want to know if the string ends with. |
Definition at line 348 of file StringUtilities.hpp.
| array1d< T > geos::stringutilities::fromStringToArray | ( | string const & | str | ) |
Take a string, and return a array1d with the cast values.
| T | the type to which the string will be cast |
| [in] | str | the string to turn into an array1d |
Definition at line 288 of file StringUtilities.hpp.
| string geos::stringutilities::join | ( | CONTAINER const & | container, |
| S const & | delim = S() |
||
| ) |
Join strings or other printable objects with a delimiter.
| CONTAINER | type of container to join |
| S | the type of delimiter, usually char, char const * or string |
| container | the container to join |
| delim | delimiter used to glue together strings |
Definition at line 74 of file StringUtilities.hpp.
| string geos::stringutilities::join | ( | IT | first, |
| IT | last, | ||
| S const & | delim = S() |
||
| ) |
Join strings or other printable objects with a delimiter.
| IT | type of iterator into the range of objects to join |
| S | type of delimiter, usually char, char const * or string |
| first | iterator to start of the range |
| last | iterator past-the-end of the range |
| delim | delimiter used to glue together strings |
Definition at line 50 of file StringUtilities.hpp.
| string geos::stringutilities::joinLambda | ( | CONTAINER const & | container, |
| S const & | delim, | ||
| LAMBDA | formattingFunc | ||
| ) |
Join strings or other printable objects returned by a formatter functor.
| CONTAINER | type of container to join |
| S | type of delimiter, usually char, char const * or string |
| LAMBDA | type of formatter functor, usually []( auto it ) -> string |
| formattingFunc | formatter function to get a formattable value from an iterator of the container |
| container | container to join |
| delim | delimiter used to glue together strings |
Definition at line 117 of file StringUtilities.hpp.
| string geos::stringutilities::joinLambda | ( | IT | first, |
| IT | last, | ||
| S const & | delim, | ||
| LAMBDA | formattingFunc | ||
| ) |
Join strings or other printable objects returned by a formatter functor.
| IT | type of iterator into the range of objects to join |
| S | type of delimiter, usually char, char const * or string |
| LAMBDA | type of formatter functor, usually []( auto it ) -> string |
| formattingFunc | formatter function to get a formattable value from a IT iterator |
| first | iterator to start of the range |
| last | iterator past-the-end of the range |
| delim | delimiter used to glue together strings |
Definition at line 91 of file StringUtilities.hpp.
| string_view geos::stringutilities::ltrimSpaces | ( | string_view | s | ) |
Trim the left string.
| [in] | s | the string to trim |
| std::ostream& geos::stringutilities::operator<< | ( | std::ostream & | os, |
| std::optional< T > const & | optValue | ||
| ) |
Overloading operator (<<) for std::optional<T>.
This function displays the value contained in a std::optional<T> object if one exists. Otherwise, it produces no output.
| T | The type of the value contained std::optional. |
| os | An output stream (for example, std::cout). |
| optValue | std::optional<T> value to display. |
Definition at line 366 of file StringUtilities.hpp.
| string geos::stringutilities::removeStringAndFollowingContent | ( | string_view | str, |
| string_view | strToRemove | ||
| ) |
Search for a string in the line, and return the line truncated before the string.
| [in] | str | the line to truncate |
| [in] | strToRemove | the string to search for in the line |
|
constexpr |
| str | The string to compare |
| prefix | A prefix we want to know if the string starts with. |
Definition at line 337 of file StringUtilities.hpp.
| CONTAINER< string > geos::stringutilities::tokenize | ( | string_view | str, |
| string_view | delimiters, | ||
| bool const | treatConsecutiveDelimAsOne = true, |
||
| bool const | preTrimStr = false |
||
| ) |
Subdivide the string in substrings by the specified delimiters.
| CONTAINER | The templated class of the results container (stdVector by default). |
| str | The string to subdivide. |
| delimiters | String that contains the list of possible delimiters. |
| treatConsecutiveDelimAsOne | If enabled, consecutive delimiters will be treated as one. If not enabled, consecutive delimiters will result in empty entries. |
| preTrimStr | If enabled, delimiters at the borders of the string will be ignored. If not enabled, those delimiters will result in in empty entries. |
Definition at line 155 of file StringUtilities.hpp.
| CONTAINER< string > geos::stringutilities::tokenizeBySpaces | ( | string_view | str | ) |
Subdivide the string in substrings by whitespaces separators (see std::isspace()). Do not create any empty substrings.
| CONTAINER | The templated class of the results container (stdVector by default). |
| str | The string to subdivide. |
Definition at line 200 of file StringUtilities.hpp.
| string geos::stringutilities::toLower | ( | string const & | input | ) |
Return a copy of the string in lower case.
| input | The input string which is not modified. |
| string geos::stringutilities::toMetricPrefixString | ( | T const & | value | ) |
Take a numerical value and convert/scale it to a string with a metric prefix. i.e. Kilo, Mega, Giga, Tera, Peta, Exa.
| T | Type of the value to be converted |
| value | The value to be converted |
| string_view geos::stringutilities::trim | ( | string_view | str, |
| string_view | charsToRemove | ||
| ) |
Trim the string.
| [in] | str | the string to trim |
| [in] | charsToRemove | the list of characters to remove |
| string_view geos::stringutilities::trimSpaces | ( | string_view | str | ) |
Trim the string so it does not starts nor ends with any whitespaces.
| [in] | str | the string to trim |
| stdVector< STRING_T > geos::stringutilities::wrapTextToMaxLength | ( | stdVector< STRING_T > const & | lines, |
| size_t & | maxLineLength | ||
| ) |
Format all the lines by detecting spaces and by dividing each lines with maximum length specified. If a word has a greater size than maxLength, it will be cut in one or many parts.
| lines | Vector containing all the lines to be formatted. |
| maxLineLength | [inout] The max length a line can have. The value is then set to the effective maximum line length |
| STRING_T | The type of the string (string or string_view) |
| string geos::stringutilities::wrapTextToMaxLength | ( | string_view | text, |
| size_t | maxLineLength | ||
| ) |
Format all the lines by detecting spaces and by dividing each lines with maximum length specified. If a word has a greater size than maxLength, it will be cut in one or many parts.
| text | The input text to wrap |
| maxLineLength | [inout] The max length a line can have. The value is then set to the effective maximum line length |
| STRING_T | The type of the string (string or string_view) |