12 #ifndef INCLUDED_LIBCYBERRADIO_PYTHONESQUE_H 13 #define INCLUDED_LIBCYBERRADIO_PYTHONESQUE_H 17 #include <LibCyberRadio/Common/BasicList.h> 25 typedef BasicStringList::iterator BasicStringListIterator;
57 static std::string
Lstrip(
const std::string& str,
const std::string& chars =
" \r\n\t\v\f");
68 static std::string
Rstrip(
const std::string& str,
const std::string& chars =
" \r\n\t\v\f");
79 static std::string
Strip(
const std::string& str,
const std::string& chars =
" \r\n\t\v\f");
94 static std::string
Replace(
const std::string& str,
const std::string &oldstr,
const std::string& newstr,
111 int maxsplit = INT_MAX);
137 static bool Startswith(
const std::string& str,
const std::string& prefix,
int start = 0,
int end = INT_MAX);
152 static bool Endswith(
const std::string& str,
const std::string& suffix,
int start = 0,
int end = INT_MAX);
162 static std::string
Basename(
const std::string& path);
static std::string Rstrip(const std::string &str, const std::string &chars=" \\\)
Strips trailing whitespace from the given string.
static std::string Strip(const std::string &str, const std::string &chars=" \\\)
Strips both leading and trailing whitespace from the given string.
virtual ~Pythonesque(void)
Destructor.
static std::string Replace(const std::string &str, const std::string &oldstr, const std::string &newstr, int count=INT_MAX)
Replaces occurrences of one substring with another within the given string.
static BasicStringList Split(const std::string &str, const std::string &sep, int maxsplit=INT_MAX)
Splits the given string into a list of string tokens.
BASIC_LIST_CONTAINER< std::string > BasicStringList
Type representing a list of strings.
Pythonesque(void)
Protected constructor; prevents class instantiation.
static bool Startswith(const std::string &str, const std::string &prefix, int start=0, int end=INT_MAX)
Determines if the given string starts with the specified prefix.
static bool Endswith(const std::string &str, const std::string &suffix, int start=0, int end=INT_MAX)
Determines if the given string ends with the specified suffix.
Defines functionality for LibCyberRadio applications.
static std::string Lstrip(const std::string &str, const std::string &chars=" \\\)
Strips leading whitespace from the given string.
static std::string Basename(const std::string &path)
Gets the base name (the file name itself, without leading path components) from the given file path...
Provides string utility functions that mimic string methods from Python.
static std::string Join(const BasicStringList &vec, const std::string &sep)
Joins a list of string tokens, concatenating them into a single string.