LogCabin
Namespaces | Functions
Core/StringUtil.h File Reference
#include <sstream>
#include <string>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  LogCabin
namespace  LogCabin::Core
namespace  LogCabin::Core::StringUtil

Functions

std::string LogCabin::Core::StringUtil::format (const char *format,...)))
 A safe version of sprintf.
std::string LogCabin::Core::StringUtil::flags (int value, std::initializer_list< std::pair< int, const char * >> flags)
 Format an ORed group of flags as a string.
bool LogCabin::Core::StringUtil::isPrintable (const char *str)
 Determine whether a null-terminated string is printable.
bool LogCabin::Core::StringUtil::isPrintable (const void *data, size_t length)
 Determine whether some data is a printable, null-terminated string.
std::string LogCabin::Core::StringUtil::join (const std::vector< std::string > &components, const std::string &glue)
void LogCabin::Core::StringUtil::replaceAll (std::string &haystack, const std::string &needle, const std::string &replacement)
 For strings, replace all occurrences of 'needle' in 'haystack' with 'replacement'.
std::vector< std::string > LogCabin::Core::StringUtil::split (const std::string &subject, char delimiter)
 Split a string into multiple components by a character.
bool LogCabin::Core::StringUtil::startsWith (const std::string &haystack, const std::string &needle)
 Return true if haystack begins with needle.
bool LogCabin::Core::StringUtil::endsWith (const std::string &haystack, const std::string &needle)
 Return true if haystack ends with needle.
template<typename T >
std::string LogCabin::Core::StringUtil::toString (const T &t)
 Return a string returned from the given object's stream operator.
std::string LogCabin::Core::StringUtil::trim (const std::string &s)
 Return a copy of the given string except with no leading or trailing whitespace.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines