Itasca C++ Interface
Loading...
Searching...
No Matches
basestring.h File Reference

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

#include "basedef.h"
#include "to.h"
#include <cctype>
#include <cwctype>
#include <string>
#include <vector>
#include <string_view>
#include "../fmt/format.h"
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>

Go to the source code of this file.

Classes

class  StringList
class  Buffer

Typedefs

using wstring = std::wstring
using string = std::string

Functions

BASE_EXPORT std::tuple< int32, bool > isInt32 (const string &in)
BASE_EXPORT std::tuple< uint32, bool > isUInt32 (const string &in)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
BASE_EXPORT std::tuple< int64, bool > isInt64 (const string &in)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
BASE_EXPORT std::tuple< uint64, bool > isUInt64 (const string &in)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
BASE_EXPORT std::tuple< double, bool > isDouble (const string &in)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
BASE_EXPORT std::tuple< bool, bool > isBool (const string &in, const string &out="on,off,true,false,yes,no")
template<typename T, typename ... Args>
T toStringConv (const string &in, Args...args, bool te, std::tuple< T, bool >(*f)(const string &, Args...))
int32 toInt32 (const string &in, bool throwException=false)
uint32 toUInt32 (const string &in, bool throwException=false)
int64 toInt64 (const string &in, bool throwException=false)
uint64 toUInt64 (const string &in, bool throwException=false)
double toDouble (const string &in, bool throwException=false)
bool toBool (const string &in, const string &out="on,off,true,false,yes,no", bool throwException=false)
BASE_EXPORT string tostring (const std::wstring &s)
BASE_EXPORT string tostring (const std::u16string &s)
BASE_EXPORT string tostring (const std::u32string &s)
BASE_EXPORT std::wstring towstring (const string &s)
BASE_EXPORT std::wstring towstring (const std::u16string &s)
BASE_EXPORT std::u16string tou16string (const string &s)
BASE_EXPORT std::u16string tou16string (const std::wstring &s)
BASE_EXPORT std::u16string tou16string (const std::string_view &s)
BASE_EXPORT std::u32string tou32string (const std::string &s)
BASE_EXPORT std::u32string tou32string (const std::string_view &s)
BASE_EXPORT string toUpper (const string &s)
BASE_EXPORT string toLower (const string &s)
BASE_EXPORT string capitalizeFirstLetter (const string &s)
template<typename T, typename U>
T join (const std::vector< T > &s, const U &sep)
BASE_EXPORT std::vector< string > split (const string &s, const string &sep, bool keepEmptyParts=false)
BASE_EXPORT std::vector< string > splitRegex (const string &s, const string &regex, bool keepEmptyParts=false)
BASE_EXPORT string matchRegex (const string &s, const string &regex, string::size_type start=0)
BASE_EXPORT string replaceRegex (const string &s, const string &regex, const string &after)
BASE_EXPORT string::size_type findRegex (const string &s, const string &regex, string::size_type start=0)
BASE_EXPORT bool exactMatchRegex (const string &s, const string &regex)
BASE_EXPORT string trimmed (const string &s)
BASE_EXPORT string simplified (const string &s)
BASE_EXPORT string replaceAll (const string &s, const string &sub, const string &newsub)
BASE_EXPORT string toBase64 (const std::vector< char > &in)
BASE_EXPORT std::vector< char > fromBase64 (const string &in)
BASE_EXPORT bool startsWith (const string &in, const string &check, bool caseSensitive=false)
BASE_EXPORT bool endsWith (const string &in, const string &check, bool caseSensitive=false)
BASE_EXPORT string clipLen (const string &in, string::size_type length)
BASE_EXPORT string cleanupTypename (const char *name)
BASE_EXPORT string convertPercentToBracket (const string &s)
BASE_EXPORT string remove (const string &s, char c)
BASE_EXPORT int32 caseInsensitiveCompare (const string &s1, const string &s2)
BASE_EXPORT int32 caseInsensitiveCompare (const string &s1, const std::string_view &s2)
int32 caseInsensitiveCompare (const string &s1, const char *str)
BASE_EXPORT uint64 caseInsensitiveHash (const string &s)
BASE_EXPORT uint64 caseInsensitiveFind (const string &s1, const string &s2, string::size_type start=0)
BASE_EXPORT string caseInsensitiveReplace (const string &start, const string &before, const string &after)
BASE_EXPORT bool caseInsensitiveContains (const std::vector< string > &all, const string &s2)
BASE_EXPORT uint64 caseInsensitiveFind (const std::vector< string > &all, const string &s2)
BASE_EXPORT bool checkLeft (const string &s, const string &c)
bool equal (const string &s, const string &c)
bool contains (const string &s, const string &s2)

Detailed Description

QString helper functions, plus some additions.

includes std::string and additional functions not included in the standard.