|
WarpX
|
Functions | |
| bool | is_in (const std::vector< std::string > &vect, const std::string &elem) |
| bool | is_in (const std::vector< std::string > &vect, const std::vector< std::string > &elems) |
| template<typename Container > | |
| auto | split (std::string const &instr, std::string const &separator, bool const trim=false, std::string const &trim_space=" \) |
| Splits a string using a string separator. This is somewhat similar to amrex::Tokenize. The main difference is that, if the separator ":" is used, amrex::Tokenize will split ":3::2" into ["3","2"] while this functio will split ":3::2" into ["","3","","2"]. This function can also perform a trimming to remove whitespaces (or any other arbitrary string) from the split string. More... | |
| bool WarpXUtilStr::is_in | ( | const std::vector< std::string > & | vect, |
| const std::string & | elem | ||
| ) |
Return true if elem is in vect, false otherwise
| [in] | vect | vector of strings, typically names |
| [in] | elem | single string |
| bool WarpXUtilStr::is_in | ( | const std::vector< std::string > & | vect, |
| const std::vector< std::string > & | elems | ||
| ) |
Return true if any element in elems is in vect, false otherwise
| [in] | vect | vector of strings, typically names |
| [in] | elems | vector of string |
| auto WarpXUtilStr::split | ( | std::string const & | instr, |
| std::string const & | separator, | ||
| bool const | trim = false, |
||
| std::string const & | trim_space = " \t" |
||
| ) |
Splits a string using a string separator. This is somewhat similar to amrex::Tokenize. The main difference is that, if the separator ":" is used, amrex::Tokenize will split ":3::2" into ["3","2"] while this functio will split ":3::2" into ["","3","","2"]. This function can also perform a trimming to remove whitespaces (or any other arbitrary string) from the split string.
| Container | the type of the split string. |
| [in] | instr | the input string |
| [in] | separator | the separator string |
| [in] | trim | true to trim the split string, false otherwise. |
| [in] | trim_space | the string to trim if trim is true. |
1.8.13