|
void | Xor (Span< std::byte > write, Span< const std::byte > key, size_t key_offset=0) |
|
template<typename T > |
T * | AnyPtr (const std::any &any) noexcept |
| Helper function to access the contained object of a std::any instance. More...
|
|
LockResult | LockDirectory (const fs::path &directory, const fs::path &lockfile_name, bool probe_only) |
|
template<typename Tdst , typename Tsrc > |
void | insert (Tdst &dst, const Tsrc &src) |
| Simplification of std insertion. More...
|
|
template<typename TsetT , typename Tsrc > |
void | insert (std::set< TsetT > &dst, const Tsrc &src) |
|
template<class... Ts> |
| Overloaded (Ts...) -> Overloaded< Ts... > |
| Explicit deduction guide (not needed after clang-17) More...
|
|
template<typename T > |
bilingual_str | ErrorString (const Result< T > &result) |
|
consteval uint8_t | ConstevalHexDigit (const char c) |
| consteval version of HexDigit() without the lookup table. More...
|
|
template<util::detail::Hex str> |
constexpr auto | operator""_hex () |
|
template<util::detail::Hex str> |
constexpr auto | operator""_hex_u8 () |
|
template<util::detail::Hex str> |
constexpr auto | operator""_hex_v () |
|
template<util::detail::Hex str> |
auto | operator""_hex_v_u8 () |
|
void | ReplaceAll (std::string &in_out, const std::string &search, const std::string &substitute) |
|
template<typename T = Span<const char>> |
std::vector< T > | Split (const Span< const char > &sp, std::string_view separators) |
| Split a string on any char found in separators, returning a vector. More...
|
|
template<typename T = Span<const char>> |
std::vector< T > | Split (const Span< const char > &sp, char sep) |
| Split a string on every instance of sep, returning a vector. More...
|
|
std::vector< std::string > | SplitString (std::string_view str, char sep) |
|
std::vector< std::string > | SplitString (std::string_view str, std::string_view separators) |
|
std::string_view | TrimStringView (std::string_view str, std::string_view pattern=" \f\n\r\t\v") |
|
std::string | TrimString (std::string_view str, std::string_view pattern=" \f\n\r\t\v") |
|
std::string_view | RemoveSuffixView (std::string_view str, std::string_view suffix) |
|
std::string_view | RemovePrefixView (std::string_view str, std::string_view prefix) |
|
std::string | RemovePrefix (std::string_view str, std::string_view prefix) |
|
template<typename C , typename S , typename UnaryOp > |
auto | Join (const C &container, const S &separator, UnaryOp unary_op) |
| Join all container items. More...
|
|
template<typename C , typename S > |
auto | Join (const C &container, const S &separator) |
|
std::string | MakeUnorderedList (const std::vector< std::string > &items) |
| Create an unordered multi-line list of items. More...
|
|
bool | ContainsNoNUL (std::string_view str) noexcept |
| Check if a string does not contain any embedded NUL (\0) characters. More...
|
|
template<typename T > |
std::string | ToString (const T &t) |
| Locale-independent version of std::to_string. More...
|
|
template<typename T1 , size_t PREFIX_LEN> |
bool | HasPrefix (const T1 &obj, const std::array< uint8_t, PREFIX_LEN > &prefix) |
| Check whether a container begins with the given prefix. More...
|
|
void | TraceThread (std::string_view thread_name, std::function< void()> thread_func) |
| A wrapper for do-something-once thread functions. More...
|
|
void | ThreadRename (const std::string &) |
| Rename a thread both in terms of an internal (in-memory) name as well as its system thread name. More...
|
|
void | ThreadSetInternalName (const std::string &) |
| Set the internal (in-memory) name of the current thread only. More...
|
|
std::string | ThreadGetInternalName () |
| Get the thread's internal (in-memory) name; used e.g. More...
|
|
template<typename T = Span<const char>>
std::vector< T > util::Split |
( |
const Span< const char > & |
sp, |
|
|
char |
sep |
|
) |
| |
Split a string on every instance of sep, returning a vector.
If sep does not occur in sp, a singleton with the entirety of sp is returned.
Note that this function does not care about braces, so splitting "foo(bar(1),2),3) on ',' will return {"foo(bar(1)", "2)", "3)"}.
Definition at line 131 of file string.h.
template<typename T = Span<const char>>
std::vector< T > util::Split |
( |
const Span< const char > & |
sp, |
|
|
std::string_view |
separators |
|
) |
| |
Split a string on any char found in separators, returning a vector.
If sep does not occur in sp, a singleton with the entirety of sp is returned.
Note that this function does not care about braces, so splitting "foo(bar(1),2),3) on ',' will return {"foo(bar(1)", "2)", "3)"}.
Definition at line 107 of file string.h.