OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
StringHelper.cpp File Reference
#include "Log.hpp"
#include "StringHelper.hpp"
#include <algorithm>
Include dependency graph for StringHelper.cpp:

Namespaces

 OpenAB
 namespace OpenAB
 

Functions

bool OpenAB::contains (const std::vector< std::string > &vec, const std::string &str)
 Checks if given string is contained in vector of strings. More...
 
void OpenAB::trimWhitespaces (std::string &str)
 Removes whitespaces from beginning and end of given string. More...
 
void OpenAB::trimSpaces (std::string &str)
 Removes whitespaces and spaces from beginning and end of given string. More...
 
std::vector< std::string > OpenAB::tokenize (const std::string &str, char delimiter, bool unique=false, bool leaveEmptyTokens=true)
 Tokenizes string. Uses provided delimiter for tokens, process can be controlled by behavior in case of duplicated and empty tokens. More...
 
void OpenAB::eraseAllOccurences (std::string &str, char toRemove)
 Removes all occurences of given character from string. More...
 
std::string OpenAB::cut (const std::string &str, const std::string &begin, const std::string &end, std::string::size_type &pos)
 Cuts part of string contained between two substrings. More...
 
std::vector< std::string > OpenAB::parserURL (const std::string &url)
 Parses URL into parts. URL is parsed into four parts: scheme (http, https, ftp, etc.), host, path and query, eg. http://www.google.com/search?q=test will be parsed into: More...
 
std::string OpenAB::parseURLHostPart (const std::string &url)
 Parses host part out of URL. More...
 
void OpenAB::substituteAll (std::string &str, const std::string &from, const std::string &to)
 Substitutes all occurrences of given substring. More...
 
bool OpenAB::beginsWith (const std::string &str, const std::string &substr)
 Checks if given string begins with given substring. More...
 
bool OpenAB::endsWith (const std::string &str, const std::string &substr)
 Checks if given string ends with given substring. More...
 
bool OpenAB::getUnfoldedLine (std::istream &is, std::string &str)
 
void OpenAB::linearize (std::string &str)
 Unfolds all lines in provided string. check if it does not duplicates functionality from getUnfoldedLine. More...
 
void OpenAB::unquoteSpecialCharacters (std::string &str)
 Removes quotation of special characters e.g. converts "\," into ",". More...
 
std::string OpenAB::percentDecode (const std::string &uri)