LiteSQL  0.3.10
Functions
string.hpp File Reference

helpful string utils More...

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

Go to the source code of this file.

Functions

template<class T >
std::string litesql::toString (T a)
 returns string representation of passed parameter if it can be written to ostringstream
 
bool litesql::startsWith (const std::string &what, const std::string &with)
 returns true if 'what' starts with 'with'
 
bool litesql::endsWith (const std::string &what, const std::string &with)
 returns true if 'what' end with 'with'
 
std::string litesql::toLower (std::string s)
 returns lower-case version of the string
 
std::string litesql::toUpper (std::string s)
 returns upper-case version of the string
 
std::string litesql::capitalize (const std::string &s)
 
std::string litesql::decapitalize (const std::string &s)
 
std::string litesql::rstrip (std::string s)
 returns a string with no empty characters at the end of the string
 
std::string litesql::lstrip (std::string s)
 returns a string with no empty characters at the beginning of the string
 
std::string litesql::replace (const std::string &s, const std::string &what, const std::string &with)
 returns a copy string 's' where 'what' is replaced with 'with'
 
int litesql::hexToInt (const std::string &s)
 converts string representation of a hex number to integer
 
int litesql::atoi (const std::string &s)
 string version of atoi
 
std::string litesql::operator* (int amount, const std::string &s)
 returns a string which is duplicated 'amount' times
 
std::string litesql::operator* (const std::string &s, int amount)
 returns a string which is duplicated 'amount' times
 
std::string litesql::escapeSQL (const std::string &str)
 escapes ' characters so that they do not break SQL statements. More...
 

Detailed Description

helpful string utils

Function Documentation

◆ escapeSQL()

std::string litesql::escapeSQL ( const std::string &  str)

escapes ' characters so that they do not break SQL statements.

Note: 'NULL' is escaped to NULL

Referenced by litesql::Backend::groupInsert(), and litesql::Database::insert().


SourceForge.net Logo