Itasca C++ Interface
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Classes | Macros | Typedefs | Functions
basestring.h File Reference

QString helper functions, plus some additions. More...

#include "basedef.h"
#include <string>
#include <cctype>
#include "base/fmt/format.h"
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>

Go to the source code of this file.

Classes

class  StringList
 
struct  StringCILess
 
struct  StringCIEqual
 
struct  StringCIHash
 

Macros

#define FMT_API   BASE_EXPORT
 
#define FMT_EXTERN_TEMPLATE_API   BASE_EXPORT
 

Typedefs

using wstring = std::wstring
 
using string = std::string
 
using String = std::wstring
 
template<typename T >
using StringMap = std::map< string, T, StringCILess >
 
template<typename T >
using StringHashMap = std::unordered_map< string, T, StringCIHash, StringCIEqual >
 
template<typename T >
using StringSet = std::set< string, T, StringCILess >
 
template<typename T >
using StringHashSet = std::unordered_set< string, T, StringCIHash, StringCIEqual >
 

Functions

BASE_EXPORT bool isInt (const string &in, int32 *i=nullptr)
 
BASE_EXPORT bool isUInt (const string &in, uint32 *u=nullptr)
 
BASE_EXPORT bool isLong (const string &in, int64 *l=nullptr)
 
BASE_EXPORT bool isULong (const string &in, uint64 *ul=nullptr)
 
BASE_EXPORT bool isDouble (const string &in, double *d=nullptr)
 
BASE_EXPORT bool isBool (const string &in, bool *b=nullptr, const string &out="on,off,true,false,yes,no")
 
int32 toInt (const string &in)
 
uint32 toUInt (const string &in)
 
int64 toLong (const string &in)
 
uint64 toULong (const string &in)
 
double toDouble (const string &in)
 
bool toBool (const string &in, const string &out="on,off,true,false,yes,no")
 
BASE_EXPORT string tostring (const std::wstring &s)
 
BASE_EXPORT std::wstring towstring (const string &s)
 
BASE_EXPORT int32 caseInsensitiveCompare (const string &s1, const string &s2)
 
BASE_EXPORT string toUpper (const string &s)
 
BASE_EXPORT string toLower (const string &s)
 
BASE_EXPORT string join (const std::vector< string > &s, const string &sep)
 
BASE_EXPORT std::vector< string > split (const string &s, const string &sep, bool keepEmptyParts=false)
 
BASE_EXPORT string trimmed (const string &s)
 

Detailed Description

QString helper functions, plus some additions.