Bitcoin Core  0.19.99
P2P Digital Currency
Functions
string.h File Reference
#include <attributes.h>
#include <cstring>
#include <string>
#include <vector>
Include dependency graph for string.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

NODISCARD std::string TrimString (const std::string &str, const std::string &pattern=" \\\)
 
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)
 
NODISCARD bool ValidAsCString (const std::string &str) noexcept
 Check if a string does not contain any embedded NUL (\0) characters. More...
 

Function Documentation

◆ Join() [1/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
listThe list to join
separatorThe separator
unary_opApply this operator to each item in the list

Definition at line 32 of file string.h.

Here is the caller graph for this function:

◆ Join() [2/2]

std::string Join ( const std::vector< std::string > &  list,
const std::string &  separator 
)
inline

Definition at line 42 of file string.h.

Here is the call graph for this function:

◆ TrimString()

NODISCARD std::string TrimString ( const std::string &  str,
const std::string &  pattern = " \f\n\r\t\v" 
)
inline

Definition at line 14 of file string.h.

Here is the caller graph for this function:

◆ ValidAsCString()

NODISCARD bool ValidAsCString ( const std::string &  str)
inlinenoexcept

Check if a string does not contain any embedded NUL (\0) characters.

Definition at line 50 of file string.h.

Here is the caller graph for this function: