Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
text Namespace Reference

Classes

class  ConsoleComments
 

Functions

std::string trim_space (const std::string &s)
 
std::string trim_space_end (std::string s)
 s without the white space (as trim_space) at its end; its start as it is.
 
std::string trim_blank (const std::string &s)
 
std::string lower_ascii (std::string s)
 A..Z as a..z, every other byte as it is.
 
std::string capitalise_ascii (std::string s)
 
bool starts_with (const std::string &s, const char *prefix)
 
bool starts_with (const std::string &s, const std::string &prefix)
 
bool ends_with (const std::string &s, const std::string &suffix)
 
std::vector< std::string > lines (const std::string &s)
 
std::string short_url (const std::string &url)
 
std::string url_encode (const std::string &s)
 
std::string join (const std::vector< std::string > &parts, const std::string &sep)
 

Function Documentation

◆ capitalise_ascii()

std::string text::capitalise_ascii ( std::string  s)
inline

The first byte a..z as A..Z ("play time" -> "Play time"); a text that starts with anything else (a digit, a UTF-8 character) as it is.

◆ ends_with()

bool text::ends_with ( const std::string &  s,
const std::string &  suffix 
)
inline

◆ join()

std::string text::join ( const std::vector< std::string > &  parts,
const std::string &  sep 
)
inline

The parts one after the other, sep between two of them: {"a", "b"} with "\n" -> "a\nb"; none -> "".

◆ lines()

std::vector< std::string > text::lines ( const std::string &  s)
inline

The lines of s, split at each \n, a \r before it dropped (CRLF read as LF). The empty ones too: a text that ends with \n ends with an empty line, and "" is one empty line.

◆ lower_ascii()

std::string text::lower_ascii ( std::string  s)
inline

A..Z as a..z, every other byte as it is.

◆ short_url()

std::string text::short_url ( const std::string &  url)
inline

"https://ko-fi.com/jigsawfr" -> "ko-fi.com/jigsawfr": what to type by hand. A text without a scheme as it is.

◆ starts_with() [1/2]

bool text::starts_with ( const std::string &  s,
const char *  prefix 
)
inline

◆ starts_with() [2/2]

bool text::starts_with ( const std::string &  s,
const std::string &  prefix 
)
inline

◆ trim_blank()

std::string text::trim_blank ( const std::string &  s)
inline

s without the spaces and tabs at either end (what Markdown calls blank); line ends stay.

◆ trim_space()

std::string text::trim_space ( const std::string &  s)
inline

s without the white space (std::isspace in the C locale: space, \t, \n, \v, \f, \r) at either end.

◆ trim_space_end()

std::string text::trim_space_end ( std::string  s)
inline

s without the white space (as trim_space) at its end; its start as it is.

◆ url_encode()

std::string text::url_encode ( const std::string &  s)
inline

s percent-encoded (RFC 3986) for a URL's query: the unreserved characters (A..Z, a..z, 0..9, -_.~) as they are, every other byte as XX ("a b/é" -> "a%20b%2F%C3%A9").