appkit  1.5.1
RoadNarrows Robotics Application Kit
StringTheory.h File Reference

Of string spaces and their strangian operators. More...

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>

Go to the source code of this file.

Namespaces

 rnr
 RoadNarrows Robotics.
 
 rnr::str
 String.
 

Typedefs

typedef std::vector< std::string > rnr::str::StringVec
 Useful types. More...
 

Functions

std::string rnr::str::okstr (bool b)
 Convert boolean to "ok" or "not-ok". More...
 
std::string rnr::str::space (unsigned n)
 Create space string. More...
 
size_t rnr::str::split (const std::string &str, const char delim, StringVec &elems)
 Split string. More...
 
StringVec rnr::str::split (const std::string &str, const char delim)
 Split string. More...
 
std::string & rnr::str::ltrim (std::string &str)
 Trim string in-place of leading whitespace. More...
 
std::string rnr::str::ltrim (const char *s)
 Trim copy of string of leading whitespace. More...
 
std::string & rnr::str::rtrim (std::string &str)
 Trim string in-place of trailing whitespace. More...
 
std::string rnr::str::rtrim (const char *s)
 Trim copy of string of trailing whitespace. More...
 
std::string & rnr::str::trim (std::string &str)
 Trim string in-place of leading and trailing whitespace. More...
 
std::string rnr::str::trim (const char *s)
 Trim copy of string of leading and trailing whitespace. More...
 
std::string & rnr::str::replace (const std::string &what, const std::string &with, std::string &str)
 In-place replace all whats in string with with. More...
 
std::string rnr::str::replace (const std::string &what, const std::string &with, const char *s)
 Copy replace all whats in string with with. More...
 
std::string rnr::str::lowercase (const std::string &str)
 Convert in-place string to lower case. More...
 
std::string rnr::str::lowercase (const char *s)
 Convert copy of string to lower case. More...
 
std::string rnr::str::uppercase (const std::string &str)
 Convert string to upper case. More...
 
std::string rnr::str::uppercase (const char *s)
 Convert copy of string to upper case. More...
 
size_t rnr::str::gcss (const std::string &str1, const std::string &str2, const size_t pos=0)
 Find the length of the Greatest Common SubString. More...
 
int rnr::str::tobool (const std::string &str, bool &val)
 Convert string to boolean. More...
 
int rnr::str::tolong (const std::string &str, long &val)
 Convert string to a long integer. More...
 
int rnr::str::todouble (const std::string &str, double &val)
 Convert string to a double-precision floating-point number. More...
 
std::string rnr::str::prettify (const std::string &str)
 Prettify string. More...
 
std::string rnr::str::c14n (const std::string &str)
 Simple canonicalization of a string. More...
 
std::string rnr::str::c14n (const str::StringVec &tokens)
 Canonicalization of a list of tokens into a string. More...
 

Variables

const char * rnr::str::FalseHood []
 Falsehood and truthhood strings. Each list termintate with a NULL. More...
 
const char * rnr::str::TruthHood []
 strings that equate to true More...
 

Detailed Description

Of string spaces and their strangian operators.

Author
Robin Knight (robin.nosp@m..kni.nosp@m.ght@r.nosp@m.oadn.nosp@m.arrow.nosp@m.s.co.nosp@m.m)
Copyright
© 2016-2017. RoadNarrows LLC.
http://www.roadnarrows.com
All Rights Reserved
License:
MIT

Definition in file StringTheory.h.