20 #ifndef __STRING_STRING_UTILS_H__
21 #define __STRING_STRING_UTILS_H__
28 bool IsUpper(
const std::string &
string);
30 bool IsLower(
const std::string &
string);
32 bool IsNumber(
const std::string &
string);
36 bool HasPrefix(
const std::string &
string,
const std::string &prefix);
38 bool HasSuffix(
const std::string &
string,
const std::string &suffix);
40 bool HasExtension(
const std::string &
string,
const std::string &extension);
42 void ToUpper(std::string *
string);
44 void ToLower(std::string *
string);
46 bool ReplaceAll(std::string *
string,
const std::string &replace_this,
47 const std::string &with_this);
49 bool ReplaceAllChar(std::string *
string,
char replace_this,
char with_this);
57 const std::string &extension,
58 const bool include_date =
true);
61 std::string
GetDir(
const std::string &
string);
64 std::string
GetPath(
const std::string &
string);
67 std::string
GetRootDir(
const std::string &
string);
86 void ReplaceExtension(std::string *
string,
const std::string &new_extension);
92 bool Tokenize(
const std::string &
string,
const std::vector<char> &delimiters,
93 std::vector<std::string> *tokens);
96 std::vector<std::string> *tokens);
102 std::string
StringScanf(
const std::string &
string);
108 std::vector<size_t>
FindAllOf(
const std::string &
string);
110 void RemoveFirstOf(std::string *
string,
const std::string &remove_this);
112 void RemoveLastOf(std::string *
string,
const std::string &remove_this);
114 void RemoveAll(std::string *
string,
const std::string &remove_this);
116 std::string
Substring(
const std::string &
string);
120 std::string
After(
const std::string &
string,
const std::string &after_this);
122 std::string
Before(
const std::string &
string,
const std::string &before_this);
124 void Append(std::string *base,
const std::string &append);
126 void Append(std::string *first,
const std::vector<std::string> &second);
134 bool TrimFromTo(std::string *
string,
size_t from,
size_t to);
142 void Reverse(std::string *
string);
void ReplaceExtension(std::string *string, const std::string &new_extension)
bool TrimFromBackToLength(std::string *string, size_t length)
void ToLower(std::string *string)
void Append(std::string *base, const std::string &append)
std::string GetRootDir(const std::string &string)
bool ExtensionsEquivalent(const std::string &one, const std::string &two)
std::string CreateTimestampedFilename(const std::string &base, const std::string &extension, const bool include_date=true)
size_t FindLastOf(const std::string &string)
bool RemovePrefix(std::string *string)
bool TrimFromFrontToLength(std::string *string, size_t length)
bool IsUpper(const std::string &string)
bool IsLower(const std::string &string)
std::string Before(const std::string &string, const std::string &before_this)
std::string GetPath(const std::string &string)
bool RemoveSuffix(std::string *string)
std::vector< size_t > FindAllOf(const std::string &string)
std::string GetFileNameNoExtension(const std::string &string)
bool RemoveNumbers(std::string *string)
bool TokenizeFileString(const std::string &file_string, std::vector< std::string > *tokens)
void ToUpper(std::string *string)
void RemoveAll(std::string *string, const std::string &remove_this)
bool HasPrefix(const std::string &string, const std::string &prefix)
std::string StringPrintf(const std::string &string)
bool RemoveExtension(std::string *string)
std::string GetExtension(const std::string &string)
std::string JoinFilePath(const std::vector< std::string > &strings)
std::string GetDir(const std::string &string)
bool IsNumber(const std::string &string)
void RemoveLastOf(std::string *string, const std::string &remove_this)
std::string StringScanf(const std::string &string)
bool FileNamesEquivalent(const std::string &one, const std::string &two)
std::string After(const std::string &string, const std::string &after_this)
bool TrimFromTo(std::string *string, size_t from, size_t to)
void TrimWhiteSpace(std::string *string)
std::string GetFileName(const std::string &string)
size_t FindFirstOf(const std::string &string)
bool ReplaceAll(std::string *string, const std::string &replace_this, const std::string &with_this)
bool HasSuffix(const std::string &string, const std::string &suffix)
std::string Substring(const std::string &string)
bool FilePathsEquivalent(const std::string &one, const std::string &two)
bool ReplaceAllChar(std::string *string, char replace_this, char with_this)
bool HasExtension(const std::string &string, const std::string &extension)
bool IsAlphabetic(const std::string &string)
void RemoveFirstOf(std::string *string, const std::string &remove_this)
bool IsAbsolutePath(const std::string &string)
bool Tokenize(const std::string &string, const std::vector< char > &delimiters, std::vector< std::string > *tokens)
void Reverse(std::string *string)