31#ifndef ARGS__TYPES_HPP__INCLUDED
32#define ARGS__TYPES_HPP__INCLUDED
34#ifdef ARGS_WSTRING_BUILD
41 #elif defined( ARGS_DEQUE )
47#elif defined( ARGS_QSTRING_BUILD )
50 #include <QTextStream>
53 #include <QLinkedList>
54 #elif defined( ARGS_DEQUE )
67 #elif defined( ARGS_DEQUE )
78#ifdef ARGS_WSTRING_BUILD
81using String = std::wstring;
84using Char = String::value_type;
100#elif defined( ARGS_DEQUE )
106#elif defined( ARGS_QSTRING_BUILD )
116 using size_type = int;
127 String(
const char * str )
132 String(
const QString & other )
138 String(
const Char * unicode, size_type size = -1 )
139 : m_str( unicode, size )
148 String( QLatin1String str )
153 String(
const QByteArray & ba )
163 operator QString ()
const
168 inline bool empty()
const
170 return m_str.isEmpty();
173 static const int npos = -1;
175 inline int find(
Char ch )
const
177 return m_str.indexOf( ch );
180 inline int find(
const String & str )
const
182 return m_str.indexOf( str.m_str );
185 QString::iterator begin()
187 return m_str.begin();
190 QString::iterator end()
195 QString::const_iterator begin()
const
197 return m_str.begin();
200 QString::const_iterator end()
const
205 QString::const_iterator cbegin()
const
207 return m_str.begin();
210 QString::const_iterator cend()
const
215 size_type length()
const
217 return m_str.length();
220 String substr( size_type pos, size_type count = npos )
const
222 return m_str.mid( pos, count );
225 friend bool operator == (
const String & s1,
const String & s2 )
227 return ( s1.m_str == s2.m_str );
230 friend bool operator != (
const String & s1,
const String & s2 )
232 return ( s1.m_str != s2.m_str );
237 return String( s1.m_str + s2.m_str );
240 friend String operator + (
const String & s1,
const char * s2 )
242 return String( s1.m_str + s2 );
245 friend String operator + (
const char * s1,
const String & s2 )
247 return String( s1 + s2.m_str );
250 friend String operator + (
const String & s1,
const char ch )
252 return String( s1.m_str + ch );
255 friend String operator + (
const char ch,
const String & s2 )
257 return String( ch + s2.m_str );
260 friend bool operator < (
const String & s1,
const String & s2 )
262 return s1.m_str < s2.m_str;
273 const Char operator [] ( size_type pos )
const
280 m_str.append( other.m_str );
287 m_str.append( QString( count, ch ) );
305 static QTextStream stream( stdout );
315#elif defined( ARGS_DEQUE )
327using Char = String::value_type;
343#elif defined( ARGS_DEQUE )
359template<
typename T >
Deleter(bool shouldIDelete)
void operator()(T *obj) noexcept
std::string String
String type.
std::vector< String > StringList
List of strings.
std::ostream OutStreamType
Out stream type.
String::value_type Char
Char type.