PIVX Core  5.6.99
P2P Digital Currency
Functions
string.h File Reference
#include "attributes.h"
#include <algorithm>
#include <array>
#include <cstdint>
#include <cstring>
#include <functional>
#include <string>
#include <vector>
Include dependency graph for string.h:

Go to the source code of this file.

Functions

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...
 

Function Documentation

◆ 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.

Here is the caller graph for this function:

◆ Join() [1/2]

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

Definition at line 36 of file string.h.

Here is the call graph for this function:

◆ 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
listThe list to join
separatorThe separator
unary_opApply this operator to each item in the list

Definition at line 26 of file string.h.

Here is the caller graph for this function:

◆ 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.

Here is the caller graph for this function: