Loxahatchee  v0.0.1-1346
Lox Convenience C++ Library
LoxString.hpp File Reference

Several simple convenience functions for string handling. More...

#include <string>
#include "LoxTypes.hpp"
Include dependency graph for LoxString.hpp:
This graph shows which files directly or indirectly include this file:

Namespaces

 Lox
 Common methods and functionality easily shared between projects.
 

Functions

bool Lox::endsWith (const std::string &str, const std::string &end, const bool trimFirst=true)
 Check to see if the text string ends with the given string. More...
 
std::string & Lox::evenWhitespace (std::string &str)
 Remove all extra whitespace, such as double spaces, newlines, and tabs. More...
 
std::string Lox::evenWhitespace (const std::string &str)
 Remove all extra whitespace, such as double spaces, newlines, and tabs. More...
 
std::string & Lox::ltrim (std::string &str)
 Left-trim whitespace. More...
 
std::string Lox::ltrim (const std::string &str)
 Left-trim whitespace. More...
 
std::string & Lox::makeLabel (std::string &str)
 Remove all special characters to create a plain text "label". Can be used to generate a filename. More...
 
std::string Lox::makeLabel (const std::string &str)
 Remove all special characters to create a plain text "label". Can be used to generate a filename. More...
 
Lox::VStr Lox::readTextFile (const std::string &filename, const bool throwIfOpenFails=true, const bool throwIfFileIsEmpty=true)
 Read all lines from a text file and store each individual line into a vector. More...
 
std::string & Lox::rtrim (std::string &str)
 Right-trim whitespace. More...
 
std::string Lox::rtrim (const std::string &str)
 Right-trim whitespace. More...
 
Lox::VStr Lox::splitOnNewlines (const std::string &str)
 Create a vector of strings by splitting on newline or carriage-return + newline. More...
 
Lox::VStr Lox::splitOnWords (const std::string &str)
 Create a vector using individual words from the provided text. More...
 
bool Lox::startsWith (const std::string &str, const std::string &start, const bool trimFirst=true)
 Check to see if the text string begins with the given string. More...
 
std::string & Lox::trim (std::string &str)
 Trim whitespace from both left and right sides. More...
 
std::string Lox::trim (const std::string &str)
 Trim whitespace from both left and right sides. More...
 

Detailed Description

Several simple convenience functions for string handling.