General Utility Library for C++14  2.12
trim.h
Go to the documentation of this file.
1 
24 #ifndef GUL14_TRIM_H_
25 #define GUL14_TRIM_H_
26 
27 #include "gul14/internal.h"
28 #include "gul14/string_util.h"
29 #include "gul14/string_view.h"
30 
31 namespace gul14 {
32 
56 GUL_EXPORT
57 std::string trim(string_view str, string_view ws_chars = default_whitespace_characters);
58 
76 GUL_EXPORT
78 
96 GUL_EXPORT
98 
116 GUL_EXPORT
118 
136 GUL_EXPORT
138 
156 GUL_EXPORT
158 
159 // TODO: Add trim_*_inplace
160 
162 
163 } // namespace gul14
164 
165 
172 #endif
GUL_EXPORT const string_view default_whitespace_characters
The default characters that are treated as whitespace by GUL.
Definition: string_util.cc:29
basic_string_view< char > string_view
A view to a contiguous sequence of chars.
Definition: string_view.h:624
GUL_EXPORT std::string trim(string_view str, string_view ws_chars=default_whitespace_characters)
Trim leading and trailing whitespace (or a custom set of characters) from a string,...
Definition: trim.cc:29
GUL_EXPORT string_view trim_right_sv(string_view str, string_view ws_chars=default_whitespace_characters)
Trim trailing whitespace (or a custom set of characters) from a string, returning a view into the ori...
Definition: trim.cc:66
GUL_EXPORT std::string trim_left(string_view str, string_view ws_chars=default_whitespace_characters)
Trim leading whitespace (or a custom set of characters) from a string, returning a new std::string.
Definition: trim.cc:46
GUL_EXPORT string_view trim_sv(string_view str, string_view ws_chars=default_whitespace_characters)
Trim leading and trailing whitespace (or a custom set of characters) from a string,...
Definition: trim.cc:34
GUL_EXPORT std::string trim_right(string_view str, string_view ws_chars=default_whitespace_characters)
Trim trailing whitespace (or a custom set of characters) from a string, returning a new std::string.
Definition: trim.cc:61
GUL_EXPORT string_view trim_left_sv(string_view str, string_view ws_chars=default_whitespace_characters)
Trim leading whitespace (or a custom set of characters) from a string, returning a view into the orig...
Definition: trim.cc:51
Definition of macros used internally by GUL.
Namespace gul14 contains all functions and classes of the General Utility Library.
Definition: doxygen.h:26
Declaration of string utility functions.
Provides a gul14::string_view that is fully compatible with C++17's std::string_view.