Cafu Engine
cf::String Namespace Reference

The String namespace gathers auxiliary string functions that are not found in that standard library. More...

Functions

bool EndsWith (const std::string &String, const std::string &Suffix)
 Returns whether the given string String ends with the given Suffix. More...
 
std::string StripExt (std::string s)
 Assumes that the given string s is a filename, removes the extension, if any, and returns the rest. More...
 
std::string GetPath (std::string s)
 Assumes that the given string s is a filename of pattern "path/filename.ext" and returns the path portion. More...
 
std::string Replace (std::string s, const std::string &search, const std::string &replace)
 Replaces in s all occurrences of search by replace, and returns the new string. More...
 
std::string ToLuaIdentifier (std::string s)
 Modifies the given string s as necessary to turn it into a valid Lua 5.2 identifier and returns the result. More...
 

Detailed Description

The String namespace gathers auxiliary string functions that are not found in that standard library.

Function Documentation

bool cf::String::EndsWith ( const std::string &  String,
const std::string &  Suffix 
)
inline

Returns whether the given string String ends with the given Suffix.

std::string cf::String::GetPath ( std::string  s)
inline

Assumes that the given string s is a filename of pattern "path/filename.ext" and returns the path portion.

std::string cf::String::Replace ( std::string  s,
const std::string &  search,
const std::string &  replace 
)
inline

Replaces in s all occurrences of search by replace, and returns the new string.

std::string cf::String::StripExt ( std::string  s)
inline

Assumes that the given string s is a filename, removes the extension, if any, and returns the rest.

std::string cf::String::ToLuaIdentifier ( std::string  s)
inline

Modifies the given string s as necessary to turn it into a valid Lua 5.2 identifier and returns the result.