ifw-core  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Functions
string.cpp File Reference
#include <string.h>
#include <algorithm>
#include <boost/regex.hpp>
#include "ctd/string/string.hpp"

Namespaces

 ctd::string
 

Functions

std::string ctd::string::Upper (const std::string &str)
 Uppercase string. More...
 
std::string ctd::string::Lower (const std::string &str)
 Lower case string. More...
 
std::string ctd::string::Trim (const std::string &str, const std::string &trim_chars)
 Trim input string for leading/trailing characters. More...
 
std::string ctd::string::Replace (const std::string &str, const std::string &old_sub_str, const std::string &new_sub_str)
 Replace occurences of "old_sub_str" with "new_sub_str" in "str". More...
 
std::string ctd::string::Truncate (const std::string &text, const int32_t max_len, const std::string &truncation_indicator="...")
 Truncate "str" if longer than "max_len". More...
 
void ctd::string::Split (const std::string &str, const std::string &separator, std::vector< std::string > &str_els)
 Split "str" according to the sequence of separator characters given. More...
 
void ctd::string::StringCopy (char *dest_buf, const char *src_buf, const int32_t max_bytes, const bool truncate=false)
 Safe string copy. If the length of “src_buf” exceeds “max_bytes” the string may either be truncated or the function fails. More...
 
void ctd::string::SplitBuffer (const std::string buffer, std::vector< std::string > &buffer_lines, const bool strip=true, const bool remove_empty_lines=true, const std::string remove_comments="")
 Split a buffer, typically a file buffer, with newline characters. More...
 
bool ctd::string::Match (const std::string &str, const std::string &reg_exp)
 Carry out a regular expression match on the given string. More...