#include "attributes.h"
#include <algorithm>
#include <array>
#include <cstdint>
#include <cstring>
#include <functional>
#include <string>
#include <vector>
Go to the source code of this file.
|
| template<typename T , typename UnaryOp > |
| std::string | Join (const std::vector< T > &list, const std::string &separator, UnaryOp unary_op) |
| | Join a list of items. More...
|
| |
| std::string | Join (const std::vector< std::string > &list, const std::string &separator) |
| |
| bool | ValidAsCString (const std::string &str) noexcept |
| | Check if a string does not contain any embedded NUL (\0) characters. More...
|
| |
| template<typename T1 , size_t PREFIX_LEN> |
| NODISCARD bool | HasPrefix (const T1 &obj, const std::array< uint8_t, PREFIX_LEN > &prefix) |
| | Check whether a container begins with the given prefix. More...
|
| |
◆ HasPrefix()
template<typename T1 , size_t PREFIX_LEN>
| NODISCARD bool HasPrefix |
( |
const T1 & |
obj, |
|
|
const std::array< uint8_t, PREFIX_LEN > & |
prefix |
|
) |
| |
|
inline |
Check whether a container begins with the given prefix.
Definition at line 53 of file string.h.
◆ Join() [1/2]
| std::string Join |
( |
const std::vector< std::string > & |
list, |
|
|
const std::string & |
separator |
|
) |
| |
|
inline |
◆ Join() [2/2]
template<typename T , typename UnaryOp >
| std::string Join |
( |
const std::vector< T > & |
list, |
|
|
const std::string & |
separator, |
|
|
UnaryOp |
unary_op |
|
) |
| |
Join a list of items.
- Parameters
-
| list | The list to join |
| separator | The separator |
| unary_op | Apply this operator to each item in the list |
Definition at line 26 of file string.h.
◆ ValidAsCString()
| bool ValidAsCString |
( |
const std::string & |
str | ) |
|
|
inlinenoexcept |
Check if a string does not contain any embedded NUL (\0) characters.
Definition at line 44 of file string.h.