ifw-core 6.0.0
Loading...
Searching...
No Matches
Namespaces | Functions
string.cpp File Reference
#include <string.h>
#include <algorithm>
#include <boost/regex.hpp>
#include <ifw/core/utils/string/string.hpp>

Namespaces

namespace  ifw
 
namespace  ifw::core
 
namespace  ifw::core::utils
 
namespace  ifw::core::utils::string
 

Functions

std::string ifw::core::utils::string::Upper (const std::string &str)
 Uppercase string.
 
std::string ifw::core::utils::string::Lower (const std::string &str)
 Lower case string.
 
std::string ifw::core::utils::string::Trim (const std::string &str, const std::string &trim_chars)
 Trim input string for leading/trailing characters.
 
std::string ifw::core::utils::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".
 
std::string ifw::core::utils::string::Truncate (const std::string &text, const int32_t max_len, const std::string &truncation_indicator="...")
 Truncate "str" if longer than "max_len".
 
void ifw::core::utils::string::Split (const std::string &str, const std::string &separator, std::vector< std::string > &str_els, int32_t exp_nb_elements=-1)
 Split "str" according to the sequence of separator characters given.
 
std::vector< std::string > ifw::core::utils::string::Split (const std::string &str, const std::string &separator, int32_t exp_nb_elements=-1)
 Split "str" according to the sequence of separator characters given.
 
void ifw::core::utils::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.
 
void ifw::core::utils::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.
 
bool ifw::core::utils::string::Match (const std::string &str, const std::string &reg_exp)
 Carry out a regular expression match on the given string.