Skip to content

Commit f8612e2

Browse files
committed
Add compare() and operator==(), != < <= >= >
Also move-up FIND_* macros in instantiation lists
1 parent 9846644 commit f8612e2

File tree

4 files changed

+342
-65
lines changed

4 files changed

+342
-65
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ The following table presents types, values and simplified, short prototypes of t
111111
| &nbsp; | &nbsp; | &nbsp; |
112112
| **Utilities** | string **to_string**(string_view sv) | string from local or C++17 std string_view |
113113
| &nbsp; | &nbsp; | &nbsp; |
114+
| **Comparison** | int **compare**(string_view lhs, string_view rhs) | negative, zero or positive for lsh is less than, equal to or greater than rhs |
115+
| &nbsp; | bool **operator==**(string_view lhs, string_view rhs) | true if lhs string is equal to rhs string |
116+
| &nbsp; | bool **operator!=**(string_view lhs, string_view rhs) | true if lhs string is not equal to rhs string |
117+
| &nbsp; | bool **operator<**(string_view lhs, string_view rhs) | true if lhs string is less than rhs string |
118+
| &nbsp; | bool **operator<=**(string_view lhs, string_view rhs) | true if lhs string is less than or equal to rhs string |
119+
| &nbsp; | bool **operator>=**(string_view lhs, string_view rhs) | true if lhs string is greater than or equal to rhs string |
120+
| &nbsp; | bool **operator>**(string_view lhs, string_view rhs) | true if lhs string is greater than or equal to rhs string |
121+
| &nbsp; | &nbsp; | &nbsp; |
114122
| **Observers** | size_t **length**(string_view sv) | length of string |
115123
| &nbsp; | size_t **size**(string_view sv) | length of string |
116124
| &nbsp; | bool **is_empty**(string_view sv) | true if string is empty |
@@ -126,9 +134,9 @@ The following table presents types, values and simplified, short prototypes of t
126134
| &nbsp; | bool **starts_with_none_of**(string_view sv, string_view set) | true if string starts with no character of set |
127135
| &nbsp; | &nbsp; | &nbsp; |
128136
| &emsp;ends_with | bool **ends_with**(string_view sv, string_view what) | true if string ends with given string |
129-
| &nbsp; | bool **ends_with_all_of**(string_view sv, string_view set) | true if string ends with all characters of set |
130-
| &nbsp; | bool **ends_with_any_of**(string_view sv, string_view set) | true if string ends with any character of set |
131-
| &nbsp; | bool **ends_with_none_of**(string_view sv, string_view set) | true if string ends with no character of set |
137+
| &nbsp; | bool **ends_with_all_of**(string_view sv, string_view set) | true if string ends with all characters of set |
138+
| &nbsp; | bool **ends_with_any_of**(string_view sv, string_view set) | true if string ends with any character of set |
139+
| &nbsp; | bool **ends_with_none_of**(string_view sv, string_view set) | true if string ends with no character of set |
132140
| &nbsp; | &nbsp; | &nbsp; |
133141
| **Searching** | size_t **find_first**(string_view sv, string_view what) | position of first occurrence of given string, or npos |
134142
| &nbsp; | size_t **find_first_of**(string_view sv, string_view set) | position of first occurrence of character in set, or npos |
@@ -277,7 +285,14 @@ strip: string with characters in set removed from left and right of string [" \t
277285
join: string with strings from collection joined separated by given separator
278286
split: split string into vector of string_view given delimiter - literal_delimiter
279287
split_left: split string into two-element tuple given delimiter - forward - literal_delimiter
280-
split_right: split string into two-element tuple given delimiter - reverse - literal_delimiter
288+
split_right: split string into two-element tuple given delimiter - reverse - literal_delimiter[TODO]
289+
compare: negative, zero or positive for lsh is less than, equal to or greater than rhs
290+
operator==(): true if lhs string is equal to rhs string
291+
operator!=(): true if lhs string is not equal to rhs string
292+
operator<(): true if lhs string is less than rhs string
293+
operator<=(): true if lhs string is less than or equal to rhs string
294+
operator>=(): true if lhs string is greater than or equal to rhs string
295+
operator>(): true if lhs string is greater than or equal to rhs string
281296
tweak header: Reads tweak header if supported [tweak]
282297
```
283298

0 commit comments

Comments
 (0)