|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
| Npcs | |
| CCppStringT | This is the templated base class for all CppString classes |
| CNotFoundException | |
| CTransTable | The internal class of translation tables, used with methods CppStringT::maketrans and CppStringT::translate |
| CSlice | Base class for slices, with start, stop and step specified values |
| CStartSlice | Base class for slices, with start, stop and step specified values |
| CStartStepSlice | Struct of slices with default step values |
| CStartStopSlice | Struct of slices with default start and stop values |
| CStepSlice | Struct of slices with default start and step values |
| CStopSlice | Struct of slices with default stop and step values |
| CStopStepSlice | Struct of slices with default stop values |
|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
This is the complete list of members for pcs::CppStringT< CharT, TraitsT, AllocatorT >, including all inherited members.
+|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
This is the templated base class for all CppString classes. + More...
+ +#include <cppstrings.h>
+ +Classes | |
| class | NotFoundException |
| class | TransTable |
| The internal class of translation tables, used with methods CppStringT::maketrans and CppStringT::translate. More... | |
+Public Member Functions | |
| CppStringT | capitalize () noexcept |
| Returns a copy of the string with its first character capitalized and the rest lowercased. | |
| CppStringT | center (const size_type width, const value_type fillch=value_type(' ')) const noexcept |
| Returns a copy of the string centered in a string of length width. | |
| constexpr bool | contains (const CppStringT &substr) const noexcept |
| Returns true if this string contains the passed string, or false otherwise. | |
| constexpr bool | contains_n (const CppStringT &sub, const size_type start, const size_type count=-1) const noexcept |
| Returns true if the passed string is found within the slice str[start:start+count-1], or false otherwise. | |
| constexpr size_type | count (const CppStringT &sub, const size_type start=0, const size_type end=-1) const noexcept |
| Returns the number of non-overlapping occurrences of substring sub in the range [start, end]. | |
| constexpr size_type | count_n (const CppStringT &sub, const size_type length) const noexcept |
| Returns the number of non-overlapping occurrences of substring sub in the range [0, length-1]. | |
| constexpr size_type | count_n (const CppStringT &sub, const size_type start, const size_type length) const noexcept |
| Returns the number of non-overlapping occurrences of substring sub in the range [start, start+length-1]. | |
| + | CppStringT (const CharT *s) |
| + | CppStringT (const CharT *s, size_type count) |
| + | CppStringT (const CharT ch) |
| + | CppStringT (const CppStringT &other) |
| + | CppStringT (const CppStringT &other, const AllocatorT &alloc) |
| + | CppStringT (const CppStringT &other, size_type pos) |
| + | CppStringT (const CppStringT &other, size_type pos, size_type count) noexcept |
| + | CppStringT (const MyBaseClass &other) |
| + | CppStringT (const MyBaseClass &other, const AllocatorT &alloc) |
| + | CppStringT (CppStringT &&other) noexcept |
| + | CppStringT (CppStringT &&other, const AllocatorT &alloc) noexcept |
| +template<class InputIt> | |
| CppStringT (InputIt first, InputIt last) | |
| + | CppStringT (MyBaseClass &&other) |
| + | CppStringT (MyBaseClass &&other, const AllocatorT &alloc) |
| + | CppStringT (MyBaseClass::size_type count, CharT ch) |
| + | CppStringT (std::initializer_list< CharT > ilist) |
| +template<class StringViewLike> | |
| CppStringT (StringViewLike &svl) | |
| +template<class StringViewLike> | |
| CppStringT (StringViewLike &svl, size_type pos, size_type n) | |
| const bool | endswith (const CppStringT &suffix) const noexcept |
| Returns true if the string ends with the specified suffix, otherwise returns false. Test runs on the whole string. | |
| const bool | endswith (const CppStringT &suffix, const size_type end) const noexcept |
| Returns true if the string ends with the specified suffix, otherwise returns false. Test begins at start of string and stops at end position. | |
| const bool | endswith (const CppStringT &suffix, const size_type start, const size_type end) const noexcept |
| Returns true if the string ends with the specified suffix, otherwise returns false. Test begins at start position and stops at end position. | |
| const bool | endswith (const std::initializer_list< CppStringT > &suffixes, const size_type start, const size_type end) const noexcept |
| Returns true if the string ends with any of the specified suffixes, otherwise returns false. Test begins at start position and stops at end position. | |
| const bool | endswith_n (const CppStringT &suffix, const size_type count) const noexcept |
| Returns true if the string ends with the specified suffix, otherwise returns false. Test begins at position 0 and stops after count positions. | |
| const bool | endswith_n (const CppStringT &suffix, const size_type start, const size_type count) const noexcept |
| Returns true if the string ends with the specified suffix, otherwise returns false. Test begins at start position and stops after count positions. | |
| const bool | endswith_n (const std::initializer_list< CppStringT > &suffixes, const size_type start, const size_type count) const noexcept |
| Returns true if the string ends with any of the specified suffixes, otherwise returns false. Test begins at start position and stops after count positions. | |
| CppStringT | expand_tabs (const size_type tabsize=8) const noexcept |
| Returns a copy of the string where all tab characters are replaced by one or more spaces, depending on the current column and the given tab size. | |
| constexpr size_type | find (const CppStringT &sub, const size_type start=0, const size_type end=-1) const noexcept |
| Returns the lowest index in the string where substring sub is found within the slice str[start:end], or -1 (i.e. 'npos') if sub is not found. | |
| constexpr size_type | find_n (const CppStringT &sub, const size_type count) const noexcept |
| Returns the lowest index in the string where substring sub is found within the slice str[0:count-1], or -1 (i.e. 'npos') if sub is not found. | |
| constexpr size_type | find_n (const CppStringT &sub, const size_type start, const size_type count) const noexcept |
| Returns the lowest index in the string where substring sub is found within the slice str[start:start+count-1], or -1 (i.e. 'npos') if sub is not found. | |
| template<class... ArgsT> | |
| CppStringT & | format (const std::basic_format_string< char, std::type_identity_t< ArgsT >... > frmt, ArgsT &&... args) |
| template<typename T, class... ArgsT> | |
| CppStringT & | format (const std::basic_format_string< T, std::type_identity_t< ArgsT >... > frmt, ArgsT &&... args) |
| Formats this string according to c++20 std::format() specification. Returns this string. | |
| template<class... ArgsT> | |
| CppStringT & | format (const std::basic_format_string< wchar_t, std::type_identity_t< ArgsT >... > frmt, ArgsT &&... args) |
| constexpr size_type | index (const CppStringT &sub, const size_type start=0, const size_type end=-1) const |
| Like find(const CppStringT&), but raises NotFoundException when the substring sub is not found. | |
| constexpr size_type | index_n (const CppStringT &sub, const size_type count) const |
| Like find_n(sub, count), but raises NotFoundException when the substring is not found. | |
| constexpr size_type | index_n (const CppStringT &sub, const size_type start, const size_type count) const |
| Like find_n(sub, start, count), but raises NotFoundException when the substring is not found. | |
| const bool | is_words_sep () const noexcept |
| Returns true if there are only whitespace and punctuation characters in the string and there is at least one character, or false otherwise. | |
| const bool | isalnum () const noexcept |
| Returns true if all characters in the string are alphanumeric and there is at least one character, or false otherwise. | |
| const bool | isalpha () const noexcept |
| Returns true if all characters in the string are alphabetic and there is at least one character, or false otherwise. | |
| const bool | isascii () const noexcept |
| Returns true if the string is empty or all characters in the string are ASCII, or false otherwise. | |
| const bool | isdecimal () const noexcept |
| Returns true if all characters in the string are decimal characters and there is at least one character, or false otherwise. | |
| const bool | isdigit () const noexcept |
| Returns true if all characters in the string are digits and there is at least one character, or false otherwise. | |
| const bool | isidentifier () const noexcept |
| Returns true if the string is not empty and is a valid identifier according to the language definition, or false otherwise. | |
| const bool | islower () const noexcept |
| Returns true if all cased characters in the string are lowercase and there is at least one cased character, or false otherwise. | |
| const bool | isnumeric () const noexcept |
| Returns true if all characters in the string are numeric characters, and there is at least one character, or false otherwise. | |
| const bool | isprintable () const noexcept |
| Returns true if all characters in the string are printable or if the string is empty, or false otherwise. | |
| const bool | ispunctuation () const noexcept |
| Returns true if the string contains only one character and if this character belongs to the ASCII punctuation set. | |
| const bool | isspace () const noexcept |
| Returns true if there are only whitespace characters in the string and there is at least one character, or false otherwise. | |
| const bool | istitle () const noexcept |
| Returns true if the string is a titlecased string and there is at least one character, or false otherwise. | |
| const bool | isupper () const noexcept |
| Returns true if all cased characters in the string are uppercase and there is at least one cased character, or false otherwise. | |
| const CppStringT | join () const noexcept |
| Empty parameters list signature. Returns a copy of current string. | |
| template<class... NextCppStringsT> +requires (sizeof...(others) > 0) | |
| CppStringT | join (const CppStringT &first, const NextCppStringsT &... others) const noexcept |
| Returns a string which is the concatenation of the strings in the parameters list. | |
| CppStringT | join (const CppStringT &s) const noexcept |
| Single parameter signature. Returns a copy of this parameter. | |
| template<const std::size_t N> | |
| CppStringT | join (const std::array< CppStringT, N > &strs) const noexcept |
| Returns a string which is the concatenation of the strings in the array parameter. | |
| CppStringT | join (const std::vector< CppStringT > &strs) const noexcept |
| Returns a string which is the concatenation of the strings in the vector parameter. | |
| CppStringT | ljust (const size_type width, const value_type fillch=value_type(' ')) const noexcept |
| Returns the string left justified in a string of length width. | |
| CppStringT & | lower () noexcept |
| In-place replaces all characters of the string with their lowercase conversion. Returns a reference to string. | |
| CppStringT | lstrip () const noexcept |
| Returns a copy of the string with leading whitespaces removed. | |
| CppStringT | lstrip (const CppStringT &removedchars) const noexcept |
| Returns a copy of the string with leading characters removed. | |
| CppStringT | operator() (const long long start, const long long stop, const long long step=1) const noexcept |
| Generates a new string according to the specified slicing values. | |
| template<typename IntT> +requires std::is_signed_v<IntT> | |
| CppStringT | operator() (Slice< IntT > slice) const noexcept |
| Generates a new string according to the specified slice. | |
| CppStringT | operator* (std::int64_t count) const noexcept |
| Generates a new string with count times the content of this string. | |
| CppStringT & | operator= (const CppStringT &) noexcept=default |
| Default copy assignment. | |
| CppStringT & | operator= (CppStringT &&) noexcept=default |
| Default move assignment. | |
| std::vector< CppStringT > | partition (const CppStringT &sep) const noexcept |
| Splits the string at the first occurrence of sep, and returns a 3-items vector containing the part before the separator, the separator itself, and the part after the separator. | |
| CppStringT | removeprefix (const CppStringT &prefix) const noexcept |
| If the string starts with the prefix string, returns a new string with the prefix removed. Otherwise, returns a copy of the original string. | |
| CppStringT | removesuffix (const CppStringT &suffix) const noexcept |
| If the string ends with the suffix string, returns a new string with the suffix removed. Otherwise, returns a copy of the original string. | |
| CppStringT | replace (const CppStringT &old, const CppStringT &new_, size_type count=-1) const noexcept |
| Returns a copy of the string with first count occurrences of substring 'old' replaced by 'new_'. | |
| constexpr size_type | rfind (const CppStringT &sub) const noexcept |
| Returns the highest index in the string where C-substring sub is found in the whole string, or -1 (i.e. 'npos') if sub is not found. | |
| constexpr size_type | rfind (const CppStringT &sub, const size_type start) const noexcept |
| Returns the highest index in the string where substring sub is found starting at start position in string, or -1 (i.e. 'npos') if sub is not found. | |
| constexpr size_type | rfind (const CppStringT &sub, const size_type start, const size_type end) const noexcept |
| Returns the highest index in the string where substring sub is found within the slice str[start:end], or -1 (i.e. 'npos') if sub is not found. | |
| constexpr size_type | rfind_n (const CppStringT &sub, const size_type count) const noexcept |
| Returns the highest index in the string where substring sub is found within the slice str[0:count-1], or -1 (i.e. 'npos') if sub is not found. | |
| constexpr size_type | rfind_n (const CppStringT &sub, const size_type start, const size_type count) const noexcept |
| Returns the highest index in the string where substring sub is found within the slice str[start:start+count-1], or -1 (i.e. 'npos') if sub is not found. | |
| constexpr size_type | rindex (const CppStringT &sub) const |
| Like rfind(sub), but raises NotFoundException when the substring is not found. | |
| constexpr size_type | rindex (const CppStringT &sub, const size_type start) const |
| Like rfind(sub, start), but raises NotFoundException when the substring is not found. | |
| constexpr size_type | rindex (const CppStringT &sub, const size_type start, const size_type end) const |
| Like rfind(sub, start, end), but raises NotFoundException when the substring is not found. | |
| constexpr size_type | rindex_n (const CppStringT &sub, const size_type count) const |
| Like rfind_n(sub, count), but raises NotFoundException when the substring is not found. | |
| constexpr size_type | rindex_n (const CppStringT &sub, const size_type start, const size_type count) const |
| Like rfind_n(sub, start, count), but raises NotFoundException when the substring is not found. | |
| CppStringT | rjust (const size_type width, const value_type fillch=value_type(' ')) const noexcept |
| Returns the string right justified in a string of length width. | |
| std::vector< CppStringT > | rpartition (const CppStringT &sep) const noexcept |
| Splits the string at the last occurrence of sep, and returns a 3-items vector containing the part before the separator, the separator itself, and the part after the separator. | |
| std::vector< CppStringT > | rsplit () noexcept |
| Returns a vector of the words in the whole string, as seperated with whitespace strings. | |
| std::vector< CppStringT > | rsplit (const CppStringT &sep) noexcept |
| Returns a vector of the words in the whole string, using sep as the delimiter string. | |
| std::vector< CppStringT > | rsplit (const CppStringT &sep, const size_type maxsplit) noexcept |
| Returns a vector of the words in the string, using sep as the delimiter string. At most maxsplit splits are done, the rightmost ones. | |
| std::vector< CppStringT > | rsplit (const size_type maxsplit) noexcept |
| Returns a vector of the words in the string, as seperated with whitespace strings. At most maxsplit splits are done, the rightmost ones. | |
| CppStringT | rstrip () const noexcept |
| Returns a copy of the string with trailing whitespaces removed. | |
| CppStringT | rstrip (const CppStringT &removedchars) const noexcept |
| Returns a copy of the string with trailing characters removed. | |
| std::vector< CppStringT > | split () noexcept |
| Returns a vector of the words in the whole string, as seperated with whitespace strings. | |
| std::vector< CppStringT > | split (const CppStringT &sep) noexcept |
| Returns a vector of the words in the whole string, using sep as the delimiter string. | |
| std::vector< CppStringT > | split (const CppStringT &sep, const size_type maxsplit) noexcept |
| Returns a vector of the words in the string, using sep as the delimiter string. At most maxsplit splits are done, the leftmost ones. | |
| std::vector< CppStringT > | split (const size_type maxsplit) noexcept |
| Returns a vector of the words in the string, as seperated with whitespace strings. At most maxsplit splits are done, the leftmost ones. | |
| std::vector< CppStringT > | splitlines (const bool keep_end=false) const noexcept |
| Return a list of the lines in the string, breaking at line boundaries. | |
| const bool | startswith (const CppStringT &prefix) const noexcept |
| Returns true if the string starts with the specified prefix, otherwise returns false. Test runs on the whole string. | |
| const bool | startswith (const CppStringT &prefix, const size_type start) const noexcept |
| Returns true if the string starts with the specified prefix, otherwise returns false. Test begins at start position and stops at end of string. | |
| const bool | startswith (const CppStringT &prefix, const size_type start, const size_type end) const noexcept |
| Returns true if the string starts with the specified prefix, otherwise returns false. Test begins at start position and stops at end position. | |
| const bool | startswith (const std::initializer_list< CppStringT > &prefixes, const size_type start, const size_type end) const noexcept |
| Returns true if the string starts with any of the specified prefixes, otherwise returns false. Test begins at start position and stops at end of string. | |
| const bool | startswith_n (const CppStringT &prefix, const size_type count) const noexcept |
| Returns true if the string starts with the specified suffix, otherwise returns false. Test begins at position 0 and stops after count positions. | |
| const bool | startswith_n (const CppStringT &prefix, const size_type start, const size_type count) const noexcept |
| Returns true if the string starts with the specified suffix, otherwise returns false. Test begins at start position and stops after count positions. | |
| const bool | startswith_n (const std::initializer_list< CppStringT > &prefix, const size_type start, const size_type count) const noexcept |
| Returns true if the string starts with any of the specified suffixes, otherwise returns false. Test begins at start position and stops after count positions. | |
| CppStringT | strip () const noexcept |
| Returns a copy of the string with the leading and trailing whitespaces removed. | |
| CppStringT | strip (const CppStringT &removedchars) const noexcept |
| Returns a copy of the string with the leading and trailing characters removed. | |
| CppStringT | substr (const size_type start, const size_type count=-1) const noexcept |
| Returns a copy of the string, starting at index start and ending after count characters. | |
| CppStringT | swapcase () const noexcept |
| Returns a copy of the string with uppercase characters converted to lowercase and vice versa. | |
| CppStringT | title () const noexcept |
| Returns a titlecased copy of the string where words start with an uppercase character and the remaining characters are lowercase. | |
| CppStringT | translate (TransTable &table) noexcept |
| Returns a copy of the string in which each character has been mapped through the given translation table. | |
| CppStringT & | upper () noexcept |
| In-place replaces all characters of the string with their uppercase conversion. Returns a reference to string. | |
| CppStringT | zfill (const size_type width) const noexcept |
| Returns a copy of the string left filled with ASCII '0' digits to make a string of length width. | |
+Static Public Member Functions | |
| static const value_type | lower (const value_type ch) noexcept |
| Returns lowercase conversion of the character. | |
| static const value_type | upper (const value_type ch) noexcept |
| Returns uppercase conversion of the character. | |
This is the templated base class for all CppString classes.
+Users should instantiate any specialization of this base class rather than this base class itself:
+
|
+ +inlinenoexcept | +
Returns a copy of the string with its first character capitalized and the rest lowercased.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string centered in a string of length width.
+Padding is done using the specified fillchar (default is an ASCII space). A copy of the original string is returned if width is less than or equal to the length of the string. The original string remains unchanged.
+ +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns true if this string contains the passed string, or false otherwise.
+This is a c++ implementation of Python keyword 'in' applied to strings.
+ +Referenced by pcs::CppStringT< char >::contains_n().
+ +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns true if the passed string is found within the slice str[start:start+count-1], or false otherwise.
+This is a c++ implementation of Python keyword 'in' applied to Python sliced strings.
+ +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns the number of non-overlapping occurrences of substring sub in the range [start, end].
+ +Referenced by pcs::CppStringT< char >::count_n(), and pcs::CppStringT< char >::count_n().
+ +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns the number of non-overlapping occurrences of substring sub in the range [0, length-1].
+ +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns the number of non-overlapping occurrences of substring sub in the range [start, start+length-1].
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string ends with the specified suffix, otherwise returns false. Test runs on the whole string.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string ends with the specified suffix, otherwise returns false. Test begins at start of string and stops at end position.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string ends with the specified suffix, otherwise returns false. Test begins at start position and stops at end position.
+ +Referenced by pcs::CppStringT< char >::endswith_n(), pcs::CppStringT< char >::endswith_n(), pcs::CppStringT< char >::endswith_n(), and pcs::CppStringT< char >::removesuffix().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string ends with any of the specified suffixes, otherwise returns false. Test begins at start position and stops at end position.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string ends with the specified suffix, otherwise returns false. Test begins at position 0 and stops after count positions.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string ends with the specified suffix, otherwise returns false. Test begins at start position and stops after count positions.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string ends with any of the specified suffixes, otherwise returns false. Test begins at start position and stops after count positions.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string where all tab characters are replaced by one or more spaces, depending on the current column and the given tab size.
+ +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns the lowest index in the string where substring sub is found within the slice str[start:end], or -1 (i.e. 'npos') if sub is not found.
+Note: this method should be used only if you need to know the position of sub. To check if sub is a substring or not, use the method contains().
+CAUTION: empty substrings are considered to be in the string if start and end positions are both less than the string size and if start <= end.
+ + +Referenced by pcs::CppStringT< char >::count(), pcs::CppStringT< char >::index(), pcs::CppStringT< char >::partition(), pcs::CppStringT< char >::replace(), and pcs::CppStringT< char >::split().
+ +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns the lowest index in the string where substring sub is found within the slice str[0:count-1], or -1 (i.e. 'npos') if sub is not found.
+Note: this method should be used only if you need to know the position of sub. To check if sub is a substring or not, use the method contains_n().
+CAUTION: empty substrings are considered to be in the string if start and end positions are both less than the string size and if start <= end. The returned position is 0.
+ + +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns the lowest index in the string where substring sub is found within the slice str[start:start+count-1], or -1 (i.e. 'npos') if sub is not found.
+Note: this method should be used only if you need to know the position of sub. To check if sub is a substring or not, use the method contains_n().
+CAUTION: empty substrings are considered to be in the string if start and end positions are both less than the string size and if start <= end. The returned position is 0.
+ + +Referenced by pcs::CppStringT< char >::find(), and pcs::CppStringT< char >::find_n().
+ +
+
|
+ +inline | +
| frmt | specialzation for char's |
+
|
+ +inline | +
Formats this string according to c++20 std::format() specification. Returns this string.
+ +
+
|
+ +inline | +
| frmt | specialzation for wchar_t's |
+
|
+ +inlinenodiscardconstexpr | +
Like find(const CppStringT&), but raises NotFoundException when the substring sub is not found.
+ + +Referenced by pcs::CppStringT< char >::index_n(), and pcs::CppStringT< char >::index_n().
+ +
+
|
+ +inlinenodiscardconstexpr | +
Like find_n(sub, count), but raises NotFoundException when the substring is not found.
+ + +
+
|
+ +inlinenodiscardconstexpr | +
Like find_n(sub, start, count), but raises NotFoundException when the substring is not found.
+ + +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if there are only whitespace and punctuation characters in the string and there is at least one character, or false otherwise.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if all characters in the string are alphanumeric and there is at least one character, or false otherwise.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if all characters in the string are alphabetic and there is at least one character, or false otherwise.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string is empty or all characters in the string are ASCII, or false otherwise.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if all characters in the string are decimal characters and there is at least one character, or false otherwise.
+Decimal characters are those that can be used to form numbers in base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO. Formally a decimal character is a character in the Unicode General Category “Nd”.
+ +Referenced by pcs::CppStringT< char >::isdigit(), and pcs::CppStringT< char >::isnumeric().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if all characters in the string are digits and there is at least one character, or false otherwise.
+Digits include decimal characters and digits that need special handling, such as the compatibility superscript digits. This covers digits which cannot be used to form numbers in base 10, like the Kharosthi numbers. Formally, a digit is a character that has the property value Numeric_Type=Digit or Numeric_Type =Decimal.
+CAUTION: current implementation of library cpp-strings does not implement above algorithm. It just returns the same result as 'isdecimal()' which is NOT what Python str library does.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string is not empty and is a valid identifier according to the language definition, or false otherwise.
+CAUTION: the current implementation of this method does not deal with the proper c++ defintiion of identifiers (see https://en.cppreference.com/w/cpp/language/identifiers and https://www.unicode.org/reports/tr31/#Table_Lexical_Classes_for_Identifiers).
+While the specification of identifiers in c++ is this one:
+identifier ::= XID_Start XID_Continue* XID_Start ::= ID_Start XID_Continue* ID_Start ::= <characters derived from the Unicode General_Category of uppercase letters, lowercase letters, titlecase letters, modifier letters, other letters, letter numbers, plus Other_ID_Start, minus Pattern_Syntax and Pattern_White_Space code points> XID_Continue ::= <characters derived from ID_Continue as per Unicode specs Section 5.1, NFKC Modifications (https://www.unicode.org/reports/tr31/#NFKC_Modifications)> ID_Continue ::= ID_Start | <characters having the Unicode General_Category of nonspacing marks, spacing combining marks, decimal number, connector punctuation, plus Other_ID_Continue, minus Pattern_Syntax and Pattern_White_Space code points>
+the currently implemented rule is this simpler one:
+identifier ::= ID_Start id_continue* id_continue ::= ID_Start | <decimal number>
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if all cased characters in the string are lowercase and there is at least one cased character, or false otherwise.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if all characters in the string are numeric characters, and there is at least one character, or false otherwise.
+CAUTION: current implementation just returns isdecimal() result, while the description of isnumeric() should be this one: Numeric characters include digit characters, and all characters that have the Unicode numeric value property. Formally, numeric characters are those with the property value Numeric_Type=Digit, Numeric_Type=Decimal or Numeric_Type=Numeric.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if all characters in the string are printable or if the string is empty, or false otherwise.
+Nonprintable characters are those characters defined in the Unicode character database as "Other" or "Separator", excepting the ASCII space (0x20) which is considered printable.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string contains only one character and if this character belongs to the ASCII punctuation set.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if there are only whitespace characters in the string and there is at least one character, or false otherwise.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string is a titlecased string and there is at least one character, or false otherwise.
+For instance uppercase characters may only follow uncased characters and lowercase characters only cased ones.
+CAUTION: current implementation only tests for uppercase characters following whitespaces and lowercase characters anywhere else.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if all cased characters in the string are uppercase and there is at least one cased character, or false otherwise.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Empty parameters list signature. Returns a copy of current string.
+ +Referenced by pcs::CppStringT< char >::join().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a string which is the concatenation of the strings in the parameters list.
+The separator between elements is the string to which this method is applied.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Single parameter signature. Returns a copy of this parameter.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a string which is the concatenation of the strings in the array parameter.
+The separator between elements is the string to which this method is applied.
+ +Referenced by pcs::CppStringT< char >::title().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a string which is the concatenation of the strings in the vector parameter.
+The separator between elements is the string to which this method is applied.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns the string left justified in a string of length width.
+Padding is done using the specified fillchar (default is an ASCII space). The original string is returned if width is less than or equal to len(s).
+ +Referenced by pcs::CppStringT< char >::zfill().
+ +
+
|
+ +inlinenoexcept | +
In-place replaces all characters of the string with their lowercase conversion. Returns a reference to string.
+Notice: uses the currently set std::locale, which is the "C" one by default or any other one as previously set by the user.
+ +Referenced by pcs::CppStringT< char >::capitalize(), and pcs::CppStringT< char >::lower().
+ +
+
|
+ +inlinestaticnodiscardnoexcept | +
Returns lowercase conversion of the character.
+Notice: uses the currently set std::locale, which is the "C" one by default or any other one as previously set by the user.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string with leading whitespaces removed.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string with leading characters removed.
+The passed string specifies the set of characters to be removed. The chars argument is not a prefix; rather, all combinations of its values are stripped. To remove a prefix, rather call method 'removeprefix()'.
+ +Referenced by pcs::CppStringT< char >::strip(), and pcs::CppStringT< char >::strip().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Generates a new string according to the specified slicing values.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Generates a new string according to the specified slice.
+A slice is a range specified as [start, stop, step]. It may also be specified as [start, stop] in which case step = 1, or as [stop] in wich case start = 0 and step = 1. Values may be negative: negative step means reverse running and negative start or stop is relative to the end of the string. Notice: the stop value specifies an out of bounds index.
+
|
+ +inlinenodiscardnoexcept | +
Generates a new string with count times the content of this string.
+ +
+
|
+ +defaultnoexcept | +
Default copy assignment.
+ +
+
|
+ +defaultnoexcept | +
Default move assignment.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Splits the string at the first occurrence of sep, and returns a 3-items vector containing the part before the separator, the separator itself, and the part after the separator.
+If the separator is not found, returns a 3-items vector containing the string itself, followed by two empty strings.
+ +
+
|
+ +inlinenodiscardnoexcept | +
If the string starts with the prefix string, returns a new string with the prefix removed. Otherwise, returns a copy of the original string.
+ +
+
|
+ +inlinenodiscardnoexcept | +
If the string ends with the suffix string, returns a new string with the suffix removed. Otherwise, returns a copy of the original string.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string with first count occurrences of substring 'old' replaced by 'new_'.
+ +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns the highest index in the string where C-substring sub is found in the whole string, or -1 (i.e. 'npos') if sub is not found.
+Note that this is an offset from the start of the string, not the end.
+Note: this method should be used only if you need to know the position of sub. To check if sub is a substring or not, use the method contains().
+CAUTION: empty substrings are considered to be in the string if start and end positions are both less than the string size and if start <= end. The returned position is the size of the string.
+ + +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns the highest index in the string where substring sub is found starting at start position in string, or -1 (i.e. 'npos') if sub is not found.
+Note that this is an offset from the start of the string, not the end.
+Note: this method should be used only if you need to know the position of sub. To check if sub is a substring or not, use the method contains().
+CAUTION: empty substrings are considered to be in the string if start and end positions are both less than the string size and if start <= end. The returned position is the size of the string.
+ + +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns the highest index in the string where substring sub is found within the slice str[start:end], or -1 (i.e. 'npos') if sub is not found.
+Note that this is an offset from the start of the string, not the end.
+Note: this method should be used only if you need to know the position of sub. To check if sub is a substring or not, use the method contains().
+CAUTION: empty substrings are considered to be in the string if start and end positions are both less than the string size and if start <= end. The returned position is the size of the string.
+ + +Referenced by pcs::CppStringT< char >::rfind(), pcs::CppStringT< char >::rfind(), pcs::CppStringT< char >::rfind_n(), pcs::CppStringT< char >::rfind_n(), pcs::CppStringT< char >::rindex(), pcs::CppStringT< char >::rpartition(), and pcs::CppStringT< char >::rsplit().
+ +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns the highest index in the string where substring sub is found within the slice str[0:count-1], or -1 (i.e. 'npos') if sub is not found.
+Note: this method should be used only if you need to know the position of sub. To check if sub is a substring or not, use the method contains_n().
+ + +
+
|
+ +inlinenodiscardconstexprnoexcept | +
Returns the highest index in the string where substring sub is found within the slice str[start:start+count-1], or -1 (i.e. 'npos') if sub is not found.
+Note: this method should be used only if you need to know the position of sub. To check if sub is a substring or not, use the method contains_n().
+ + +
+
|
+ +inlinenodiscardconstexpr | +
Like rfind(sub), but raises NotFoundException when the substring is not found.
+ + +
+
|
+ +inlinenodiscardconstexpr | +
Like rfind(sub, start), but raises NotFoundException when the substring is not found.
+ + +
+
|
+ +inlinenodiscardconstexpr | +
Like rfind(sub, start, end), but raises NotFoundException when the substring is not found.
+ + +Referenced by pcs::CppStringT< char >::rindex(), pcs::CppStringT< char >::rindex(), pcs::CppStringT< char >::rindex_n(), and pcs::CppStringT< char >::rindex_n().
+ +
+
|
+ +inlinenodiscardconstexpr | +
Like rfind_n(sub, count), but raises NotFoundException when the substring is not found.
+ + +
+
|
+ +inlinenodiscardconstexpr | +
Like rfind_n(sub, start, count), but raises NotFoundException when the substring is not found.
+ + +
+
|
+ +inlinenodiscardnoexcept | +
Returns the string right justified in a string of length width.
+Padding is done using the specified fillchar (default is an ASCII space). The original string is returned if width is less than or equal to len(s).
+ +
+
|
+ +inlinenodiscardnoexcept | +
Splits the string at the last occurrence of sep, and returns a 3-items vector containing the part before the separator, the separator itself, and the part after the separator.
+If the separator is not found, returns a 3-items vector containing the string itself, followed by two empty strings.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a vector of the words in the whole string, as seperated with whitespace strings.
+Notice: consecutive whitespaces are each regarded as a single separator. So, they each separate empty strings.
+ +Referenced by pcs::CppStringT< char >::rsplit().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a vector of the words in the whole string, using sep as the delimiter string.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a vector of the words in the string, using sep as the delimiter string. At most maxsplit splits are done, the rightmost ones.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a vector of the words in the string, as seperated with whitespace strings. At most maxsplit splits are done, the rightmost ones.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string with trailing whitespaces removed.
+ +Referenced by pcs::CppStringT< char >::strip(), and pcs::CppStringT< char >::strip().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string with trailing characters removed.
+The passed string specifies the set of characters to be removed. The chars argument is not a prefix; rather, all combinations of its values are stripped. To remove a suffix, rather call method 'removesuffix()'.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a vector of the words in the whole string, as seperated with whitespace strings.
+Notice: consecutive whitespaces are each regarded as a single separator. So, they each separate empty strings.
+ +Referenced by pcs::CppStringT< char >::rsplit(), pcs::CppStringT< char >::rsplit(), pcs::CppStringT< char >::split(), and pcs::CppStringT< char >::title().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a vector of the words in the whole string, using sep as the delimiter string.
+Notice: consecutive delimiters are not grouped together and are deemed to delimit empty strings (for example, "1,,2".split(",") returns {"1", "", "2"}). The sep argument may consist of multiple characters (for example, "1<>2<>3".split("<>") returns {"1", "2", "3"]). Splitting an empty string with a specified separator returns {""}.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a vector of the words in the string, using sep as the delimiter string. At most maxsplit splits are done, the leftmost ones.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a vector of the words in the string, as seperated with whitespace strings. At most maxsplit splits are done, the leftmost ones.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Return a list of the lines in the string, breaking at line boundaries.
+Line breaks are not included in the resulting list unless keepends is given and true.
+This method splits on the following line boundaries. In particular, the boundaries are a superset of universal newlines:
+ Line Feed \r Carriage Return \r
+ Carriage Return + Line Feed \v or \x0b Line Tabulation \f or \x0c Form Feed \x1c File Separator \x1d Group Separator \x1e Record Separator Next separators values, detected by Python method splitlines(), are currently NOT detected by CppStrings \x85 Next Line (C1 Control Code) \u2028 Line Separator \u2029 Paragraph Separator
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string starts with the specified prefix, otherwise returns false. Test runs on the whole string.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string starts with the specified prefix, otherwise returns false. Test begins at start position and stops at end of string.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string starts with the specified prefix, otherwise returns false. Test begins at start position and stops at end position.
+ +Referenced by pcs::CppStringT< char >::removeprefix(), pcs::CppStringT< char >::startswith(), and pcs::CppStringT< char >::startswith_n().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string starts with any of the specified prefixes, otherwise returns false. Test begins at start position and stops at end of string.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string starts with the specified suffix, otherwise returns false. Test begins at position 0 and stops after count positions.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string starts with the specified suffix, otherwise returns false. Test begins at start position and stops after count positions.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns true if the string starts with any of the specified suffixes, otherwise returns false. Test begins at start position and stops after count positions.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string with the leading and trailing whitespaces removed.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string with the leading and trailing characters removed.
+The passed string specifies the set of characters to be removed. The chars argument is not a prefix; rather, all combinations of its values are stripped.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string, starting at index start and ending after count characters.
+ +Referenced by pcs::CppStringT< char >::contains(), pcs::CppStringT< char >::contains_n(), pcs::CppStringT< char >::count(), pcs::CppStringT< char >::endswith(), pcs::CppStringT< char >::endswith(), pcs::CppStringT< char >::endswith(), pcs::CppStringT< char >::find_n(), pcs::CppStringT< char >::operator()(), pcs::CppStringT< char >::partition(), pcs::CppStringT< char >::removeprefix(), pcs::CppStringT< char >::removesuffix(), pcs::CppStringT< char >::replace(), pcs::CppStringT< char >::rfind(), pcs::CppStringT< char >::rpartition(), pcs::CppStringT< char >::rsplit(), pcs::CppStringT< char >::split(), pcs::CppStringT< char >::startswith(), pcs::CppStringT< char >::startswith(), pcs::CppStringT< char >::startswith_n(), pcs::CppStringT< char >::startswith_n(), and pcs::CppStringT< char >::zfill().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string with uppercase characters converted to lowercase and vice versa.
+Note that it is not necessarily true that s.swapcase().swapcase() == s.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a titlecased copy of the string where words start with an uppercase character and the remaining characters are lowercase.
+ +Referenced by pcs::CppStringT< char >::istitle().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string in which each character has been mapped through the given translation table.
+The table must be of type CppStringT::TransTable. When a character to be translated is not available as an entry in the tranlation table, it is set as is in the resulting string.
+ +
+
|
+ +inlinenoexcept | +
In-place replaces all characters of the string with their uppercase conversion. Returns a reference to string.
+Notice: uses the currently set std::locale, which is the "C" one by default or any other one as previously set by the user.
+ +Referenced by pcs::CppStringT< char >::upper().
+ +
+
|
+ +inlinestaticnodiscardnoexcept | +
Returns uppercase conversion of the character.
+Notice: uses the currently set std::locale, which is the "C" one by default or any other one as previously set by the user.
+ +
+
|
+ +inlinenodiscardnoexcept | +
Returns a copy of the string left filled with ASCII '0' digits to make a string of length width.
+A leading sign prefix ('+'/'-') is handled by inserting the padding after the sign character rather than before. The original string is returned if width is less than or equal to len(s).
+ +|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
This is the complete list of members for pcs::CppStringT< CharT, TraitsT, AllocatorT >::NotFoundException, including all inherited members.
+| MyBaseClass typedef (defined in pcs::CppStringT< CharT, TraitsT, AllocatorT >::NotFoundException) | pcs::CppStringT< CharT, TraitsT, AllocatorT >::NotFoundException | |
| NotFoundException(const std::string &what_arg) (defined in pcs::CppStringT< CharT, TraitsT, AllocatorT >::NotFoundException) | pcs::CppStringT< CharT, TraitsT, AllocatorT >::NotFoundException | inline |
| NotFoundException(const char *what_arg) (defined in pcs::CppStringT< CharT, TraitsT, AllocatorT >::NotFoundException) | pcs::CppStringT< CharT, TraitsT, AllocatorT >::NotFoundException | inline |
|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
+ +Public Types | |
| +using | MyBaseClass = std::logic_error |
+Public Member Functions | |
| + | NotFoundException (const char *what_arg) |
| + | NotFoundException (const std::string &what_arg) |
|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
This is the complete list of members for pcs::CppStringT< CharT, TraitsT, AllocatorT >::TransTable, including all inherited members.
+|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
The internal class of translation tables, used with methods CppStringT::maketrans and CppStringT::translate. + More...
+ +#include <cppstrings.h>
+Public Types | |
| +using | key_type = CharT |
| +using | value_type = CppStringT |
+Public Member Functions | |
| std::map< typename key_type, typename value_type > & | get_table () noexcept |
| < for tests purposes | |
| TransTable & | operator= (const std::map< key_type, value_type > &trans_table) noexcept |
| Assignment operator with a standard map. | |
| TransTable & | operator= (const TransTable &) noexcept=default |
| Default copy assignment. | |
| TransTable & | operator= (TransTable &&) noexcept=default |
| Default move assignment. | |
| value_type | operator[] (const key_type ch) noexcept |
| Indexing operator. | |
| TransTable () noexcept=default | |
| Default empty constructor. | |
| TransTable (const CharT *keys, const CharT *values) | |
| Creates a TransTable from two pointers to null-terminated lists of characters (#6). | |
| TransTable (const CharT *keys, const CharT *values, const CharT *not_translated) | |
| Creates a TransTable from three pointers to null-terminated lists of characters (#7). | |
| TransTable (const CppStringT &keys, const CppStringT &values) | |
| Creates a TransTable from two strings (#2). | |
| TransTable (const CppStringT &keys, const CppStringT &values, const CppStringT ¬_translated) | |
| Creates a TransTable from three strings (#3). | |
| TransTable (const CppStringT &keys, const std::initializer_list< CppStringT > &values) | |
| Creates a TransTable from a string and an initalization list (#4). | |
| TransTable (const CppStringT &keys, const std::initializer_list< CppStringT > values, const CppStringT ¬_translated) | |
| Creates a TransTable from a string, an initalization list and a string (#5). | |
| TransTable (const std::map< key_type, value_type > trans_table) | |
| Creates a TransTable from a standard map (#1). | |
| template<class StringViewLike> | |
| TransTable (const StringViewLike &keys, const StringViewLike &values) | |
| Creates a TransTable from two string views (#10). | |
| TransTable (const TransTable &) noexcept=default | |
| Default copy constructor. | |
| template<class Key1It, class ValueIt, class Key2It> | |
| TransTable (Key1It first_key, Key1It last_key, ValueIt first_value, ValueIt last_value, Key2It first_not_translated, Key2It last_not_translated) | |
| Creates a TransTable from three containers iterators (#9). | |
| template<class KeyIt, class ValueIt> | |
| TransTable (KeyIt first_key, KeyIt last_key, ValueIt first_value, ValueIt last_value) | |
| Creates a TransTable from two containers iterators (#8). | |
| TransTable (TransTable &&) noexcept=default | |
| Default move constructor. | |
| ~TransTable () noexcept=default | |
| Default descrtuctor. | |
The internal class of translation tables, used with methods CppStringT::maketrans and CppStringT::translate.
+
+
|
+ +inline | +
Creates a TransTable from a standard map (#1).
+ +Referenced by operator=(), operator=(), operator=(), TransTable(), TransTable(), and ~TransTable().
+ +
+
|
+ +inline | +
Creates a TransTable from two strings (#2).
+Parameters keys and values must have the same size. The i-th character in key is associated in the translation table with the i-th character in values.
+ +
+
|
+ +inline | +
Creates a TransTable from three strings (#3).
+Parameters keys and values must have the same size. The i-th character in key is associated in the translation table with the i -th character in values. Finally, the characters contained in string not_translated are associated in the translation table with the empty string.
+ +
+
|
+ +inline | +
Creates a TransTable from a string and an initalization list (#4).
+Parameters keys and values must have the same size. The i-th character in key is associated in the translation table with the i-th character in values.
+ +
+
|
+ +inline | +
Creates a TransTable from a string, an initalization list and a string (#5).
+Parameters keys and values must have the same size. The i-th character in key is associated in the translation table with the i -th character in values. Finally, the characters contained in string not_translated are associated in the translation table with the empty string.
+ +
+
|
+ +inline | +
Creates a TransTable from two pointers to null-terminated lists of characters (#6).
+Parameters keys and values must have the same size. The i-th character in key is associated in the translation table with the i-th character in values.
+ +
+
|
+ +inline | +
Creates a TransTable from three pointers to null-terminated lists of characters (#7).
+Parameters keys and values must have the same size. The i-th character in key is associated in the translation table with the i -th entry in values. Finally, the characters contained in string not_translated are associated in the translation table with the empty string.
+ +
+
|
+ +inline | +
Creates a TransTable from two containers iterators (#8).
+Both containers should have the same size. The i-th character in key is associated in the translation table with the i-th entry in values.
+ +
+
|
+ +inline | +
Creates a TransTable from three containers iterators (#9).
+Both containers should have the same size. The i-th character in key is associated in the translation table with the i -th character in values. Finally, the characters contained in string not_translated are associated in the translation table with the empty string.
+ +
+
|
+ +inlineexplicit | +
Creates a TransTable from two string views (#10).
+Parameters keys and values must have the same size. The i-th character in key is associated in the translation table with the i-th character in values.
+ +
+
|
+ +inlinedefaultnoexcept | +
Default empty constructor.
+ +
+
|
+ +inlinedefaultnoexcept | +
Default copy constructor.
+ +References TransTable().
+ +
+
|
+ +inlinedefaultnoexcept | +
Default move constructor.
+ +References TransTable().
+ +
+
|
+ +inlinedefaultnoexcept | +
Default descrtuctor.
+ +References TransTable().
+ +
+
|
+ +inlinenoexcept | +
< for tests purposes
+ +
+
|
+ +inlinenoexcept | +
Assignment operator with a standard map.
+ +References TransTable().
+ +
+
|
+ +inlinedefaultnoexcept | +
Default copy assignment.
+ +References TransTable().
+ +
+
|
+ +inlinedefaultnoexcept | +
Default move assignment.
+ +References TransTable().
+ +
+
|
+ +inlinenodiscardnoexcept | +
Indexing operator.
+ +|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
This is the complete list of members for pcs::Slice< IntT >, including all inherited members.
+| begin(const CppStringT< CharT > &str) noexcept | pcs::Slice< IntT > | inline |
| DEFAULT (defined in pcs::Slice< IntT >) | pcs::Slice< IntT > | static |
| end() const noexcept | pcs::Slice< IntT > | inline |
| operator*() noexcept | pcs::Slice< IntT > | inline |
| operator++() noexcept | pcs::Slice< IntT > | inline |
| operator++(int) noexcept | pcs::Slice< IntT > | inline |
| Slice(const IntT start=DEFAULT, const IntT stop=DEFAULT, const IntT step=DEFAULT) noexcept | pcs::Slice< IntT > | inline |
| start() | pcs::Slice< IntT > | inline |
| step() | pcs::Slice< IntT > | inline |
| stop() | pcs::Slice< IntT > | inline |
| ~Slice() noexcept=default | pcs::Slice< IntT > | virtual |
|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
Base class for slices, with start, stop and step specified values. + More...
+ +#include <cppstrings.h>
+
++Public Member Functions | |
| template<typename CharT = char> +requires std::is_same_v<CharT, char> || std::is_same_v<CharT, char16_t> || std::is_same_v<CharT, char32_t> || std::is_same_v<CharT, wchar_t> | |
| const IntT | begin (const CppStringT< CharT > &str) noexcept |
| < starts iterating on specified CppString. | |
| const bool | end () const noexcept |
| < returns true when iterating is over, or false otherwise. | |
| const IntT | operator* () noexcept |
| < dereferences the slice. | |
| Slice | operator++ () noexcept |
| < iterates one step, pre-increment. Caution: index may be out of bounds. Check '!end()' before dereferencing the slice. | |
| Slice | operator++ (int) noexcept |
| < iterates one step, post-increment. Caution: index may be out of bounds. Check '!end()' before dereferencing the slice. | |
| Slice (const IntT start=DEFAULT, const IntT stop=DEFAULT, const IntT step=DEFAULT) noexcept | |
| < Valued constructor | |
| IntT | start () |
| Returns the start index of this slide. | |
| IntT | step () |
| Returns the step value of this slide. | |
| IntT | stop () |
| Returns the stop index of this slide. | |
| virtual | ~Slice () noexcept=default |
| Default destructor. | |
+Static Public Attributes | |
| +static constexpr IntT | DEFAULT { std::numeric_limits<IntT>::min() } |
Base class for slices, with start, stop and step specified values.
+
+
|
+ +inlinenoexcept | +
< Valued constructor
+ +References start(), step(), and stop().
+ +Referenced by operator++(), and operator++().
+ +
+
|
+ +virtualdefaultnoexcept | +
Default destructor.
+ +
+
|
+ +inlinenoexcept | +
< starts iterating on specified CppString.
+ +
+
|
+ +inlinenodiscardnoexcept | +
< returns true when iterating is over, or false otherwise.
+ +
+
|
+ +inlinenodiscardnoexcept | +
< dereferences the slice.
+ +
+
|
+ +inlinenoexcept | +
< iterates one step, pre-increment. Caution: index may be out of bounds. Check '!end()' before dereferencing the slice.
+ +References Slice().
+ +
+
|
+ +inlinenoexcept | +
< iterates one step, post-increment. Caution: index may be out of bounds. Check '!end()' before dereferencing the slice.
+ +References Slice().
+ +
+
|
+ +inline | +
Returns the start index of this slide.
+ +Referenced by Slice(), pcs::StartSlice< IntT >::StartSlice(), pcs::StartStepSlice< IntT >::StartStepSlice(), and pcs::StartStopSlice< IntT >::StartStopSlice().
+ +
+
|
+ +inline | +
Returns the step value of this slide.
+ +Referenced by Slice(), pcs::StartStepSlice< IntT >::StartStepSlice(), pcs::StepSlice< IntT >::StepSlice(), and pcs::StopStepSlice< IntT >::StopStepSlice().
+ +
+
|
+ +inline | +
Returns the stop index of this slide.
+ +Referenced by Slice(), pcs::StartStopSlice< IntT >::StartStopSlice(), pcs::StopSlice< IntT >::StopSlice(), and pcs::StopStepSlice< IntT >::StopStepSlice().
+ +|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
| Cstd::basic_string< Char > | STL class |
| Cpcs::CppStringT< char > | |
| Cpcs::CppStringT< wchar_t > | |
| Cpcs::CppStringT< CharT, TraitsT, AllocatorT > | This is the templated base class for all CppString classes |
| Cstd::exception | STL class |
| Cstd::logic_error | STL class |
| Cpcs::CppStringT< CharT, TraitsT, AllocatorT >::NotFoundException | |
| Cpcs::Slice< IntT > | Base class for slices, with start, stop and step specified values |
| Cpcs::StartSlice< IntT > | Base class for slices, with start, stop and step specified values |
| Cpcs::StartStepSlice< IntT > | Struct of slices with default step values |
| Cpcs::StartStopSlice< IntT > | Struct of slices with default start and stop values |
| Cpcs::StepSlice< IntT > | Struct of slices with default start and step values |
| Cpcs::StopSlice< IntT > | Struct of slices with default stop and step values |
| Cpcs::StopStepSlice< IntT > | Struct of slices with default stop values |
| Cpcs::CppStringT< CharT, TraitsT, AllocatorT >::TransTable | The internal class of translation tables, used with methods CppStringT::maketrans and CppStringT::translate |
|
+ cpp-strings 1.0.0
+
+ Pythonic c++ strings
+ |
+
What if c++ strings where as easy to use as Python strings?
+Let's just use c++ strings as are Python ones, with same API or as similar API as possible.
+ Library cpp-strings is fully templated. Just download header file cppstrings.h and put it anywhere in your project. Notice: all of its stuff is declared and defined in namespace pcs - which stands for P**ythonic **C++ **S**trings.
cpp-strings is implemented with the currently most recent c++ standard available with gcc, clang and msvc c++ compilers, i.e. standard c++20.
+The code has been developed using VS2022 IDE. As such, unitary tests have been coded using Microsoft Visual Studio Cpp Unit Test Framework. The related VS project is provided with this library.
+Notice: no clang, gcc or msvc specific declarations or goodies have been use to code library cpp-strings. It should then be compilable with any of these compilers. To be able to use it with your project, just ensure that the c++ standard used with you favorite compiler is c++20:
If you want to run the unitary tests, well, use the last version of Visual Studio (i.e. VS 2022, by July 2025). The Community free version will truly be fine.
+ The vcproject associated with the unit tests in cpp-strings is already configured to use the option flag /std:c++latest since the implemented code uses a very few but very useful c++23 goodies.
Library cpp-strings +"What if c++ strings where as easy to use as Python strings?" + +Copyright (C) 2023-2025 Philippe Schmouker +contact - ph (dot) schmouker (at) gmail (dot) com + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. +
The creation of this library has been started with the aim at easing the use of strings in c++. Other projects exist, even aiming also to implement a Python-like strings API, but the only ones we have found were either started but not completed, or were not implementing the whole Python API.
+So, we started to work on Pythonic c++ strings. Library cpp-strings is now ready. It fully implements the Python API (even with a c++ implementation of slices) and it is fully tested with unitary tests.
+The implementation of library cpp-strings is fully templated and is contained into a single header file: cpp-strings/cppstrings.h. To take a whole benefit of it, just add this header file to your project and include it in your own files. It very fastly compiles. That's all!
+Header file cpp-strings/cppstrings.h defines:
The unitary tests are provided in directory cpp-strings-tests/. File cpp-strings-tests.cpp contains the related code. They has been coded using VS2022 IDE and as such, are using the Microsoft Visual Studio Cpp Unit Test Framework. The related VS project can be found in the same directory. It is already configured to create code for Release as well as for Debug configurations, and for 32-bits or 64-bits platforms at your choice.
+ This .cpp file is a great place to see cpp-strings code in action. Each structure, class, method, litteral operator and function being unitary tested, you should find there many examples of their use for all cpp-strings stuff.
The coding of this project started by March 2023 and had been put in standby mode for some months. The very first release is now availble (since July 2025), as Release 1.0.
+This release has been fully tested. It implements all Python strings API but one feature (see below). Python slices are implemented via c++ operator() as declared and defined in the templated class pcs::CppStringT<>. Python slices have next specific notation: [start : stop : step] and allow the running through range [start, stop) (notice: stop is excluded from the range) step by step. Operator (start, stop, step) acts the same way while running through the content of c++ strings.
+