31#ifndef CFGFILE__TYPES_HPP__INCLUDED
32#define CFGFILE__TYPES_HPP__INCLUDED
34#ifndef CFGFILE_DISABLE_STL
43#ifdef CFGFILE_QT_SUPPORT
52#ifndef CFGFILE_DISABLE_STL
76 using buf_t = std::vector< char_t >;
80 return std::to_wstring(
pos );
119 return ( std::iswspace(
ch ) != 0 );
129 stream.seekg( 0, std::ios::end );
147 std::size_t
skip = 0;
187 using buf_t = std::vector< char_t >;
191 return std::to_string(
pos );
227 return ( std::isspace( (
int)
ch ) != 0 );
237 stream.seekg( 0, std::ios::end );
255 std::size_t
skip = 0;
275#ifdef CFGFILE_QT_SUPPORT
338 return m_str.isEmpty();
345 return m_str.indexOf(
ch );
350 return m_str.indexOf(
str.m_str );
355 return m_str.lastIndexOf(
str.m_str );
360 return m_str.lastIndexOf(
ch );
373 return m_str.begin();
376 inline QString::iterator
end()
381 inline QString::const_iterator
begin()
const
383 return m_str.begin();
386 inline QString::const_iterator
end()
const
391 inline QString::const_iterator
cbegin()
const
393 return m_str.begin();
396 inline QString::const_iterator
cend()
const
403 return m_str.length();
421 return (
s1.m_str ==
s2.m_str );
469 m_str.append(
other.m_str );
523 return QString::number(
pos );
570#if defined(CFGFILE_DISABLE_STL) && defined(CFGFILE_QT_SUPPORT)
571using string_trait_t = qstring_trait_t;
580#define DISABLE_COPY( Class ) \
581 Class( const Class & ) = delete; \
582 Class & operator= ( const Class & ) = delete;
Exception in the library.
Definition exceptions.hpp:51
QString wrapper.
Definition types.hpp:282
int find(QChar ch) const
Definition types.hpp:343
qstring_wrapper_t(const QChar *unicode, size_type size=-1)
Definition types.hpp:306
static const int npos
Definition types.hpp:341
QString::const_iterator begin() const
Definition types.hpp:381
const QChar operator[](size_type pos) const
Definition types.hpp:462
int rfind(QChar ch) const
Definition types.hpp:358
void clear()
Definition types.hpp:481
QString::const_iterator end() const
Definition types.hpp:386
qstring_wrapper_t & append(const qstring_wrapper_t &other)
Definition types.hpp:467
QString::iterator end()
Definition types.hpp:376
qstring_wrapper_t(size_type size, QChar ch)
Definition types.hpp:290
qstring_wrapper_t(const QString &other)
Definition types.hpp:300
friend qstring_wrapper_t operator+(const qstring_wrapper_t &s1, const qstring_wrapper_t &s2)
Definition types.hpp:424
friend QTextStream & operator<<(QTextStream &to, const qstring_wrapper_t &what)
Definition types.hpp:454
void push_back(QChar ch)
Definition types.hpp:486
qstring_wrapper_t(QChar ch)
Definition types.hpp:311
bool empty() const
Definition types.hpp:336
qstring_wrapper_t & append(size_type count, QChar ch)
Definition types.hpp:474
qstring_wrapper_t & replace(size_type pos, size_type count, const qstring_wrapper_t &v)
Definition types.hpp:363
const QChar at(int position) const
Definition types.hpp:407
QString::iterator begin()
Definition types.hpp:371
friend bool operator==(const qstring_wrapper_t &s1, const qstring_wrapper_t &s2)
Definition types.hpp:418
qstring_wrapper_t(const char *str)
Definition types.hpp:295
qstring_wrapper_t(const QByteArray &ba)
Definition types.hpp:321
QString::const_iterator cbegin() const
Definition types.hpp:391
qstring_wrapper_t substr(size_type pos, size_type count=npos) const
Definition types.hpp:413
int rfind(const qstring_wrapper_t &str) const
Definition types.hpp:353
int find(const qstring_wrapper_t &str) const
Definition types.hpp:348
qstring_wrapper_t()
Definition types.hpp:286
qstring_wrapper_t(QLatin1String str)
Definition types.hpp:316
size_type length() const
Definition types.hpp:401
QString::const_iterator cend() const
Definition types.hpp:396
Trait for QString support.
Definition types.hpp:502
static bool is_at_end(istream_t &stream)
Definition types.hpp:540
static string_t from_ascii(const std::string &str)
Definition types.hpp:526
static void to_begin(istream_t &stream)
Definition types.hpp:550
static bool is_space(char_t ch)
Definition types.hpp:545
static char_t from_ascii(char ch)
Definition types.hpp:531
static void fill_buf(istream_t &stream, buf_t &buf, pos_t buf_size, pos_t &pos, pos_t size)
Definition types.hpp:560
static string_t to_string(pos_t pos)
Definition types.hpp:521
static void noskipws(istream_t &)
Definition types.hpp:536
static pos_t size_of_file(istream_t &stream)
Definition types.hpp:555
Trait for std::string support.
Definition types.hpp:170
static char_t from_ascii(char ch)
Definition types.hpp:199
static void fill_buf(istream_t &stream, buf_t &buf, pos_t buf_size, pos_t &pos, pos_t size)
Definition types.hpp:246
std::istream istream_t
Input stream type.
Definition types.hpp:178
std::streamoff pos_t
Type of pos in stream.
Definition types.hpp:181
std::string string_t
String type.
Definition types.hpp:172
static pos_t size_of_file(istream_t &stream)
Definition types.hpp:235
static bool is_at_end(istream_t &stream)
Definition types.hpp:209
static void to_begin(istream_t &stream)
Definition types.hpp:230
static string_t from_ascii(const std::string &str)
Definition types.hpp:194
string_t::value_type char_t
Char type.
Definition types.hpp:175
static string_t to_string(pos_t pos)
Definition types.hpp:189
static bool is_space(char_t ch)
Definition types.hpp:225
std::ostream ostream_t
Output stream type.
Definition types.hpp:184
std::vector< char_t > buf_t
Type of the buffer.
Definition types.hpp:187
static void noskipws(istream_t &stream)
Definition types.hpp:204
Trait for std::wstring support.
Definition types.hpp:59
static pos_t size_of_file(istream_t &stream)
Definition types.hpp:127
static void noskipws(istream_t &stream)
Definition types.hpp:96
static void fill_buf(istream_t &stream, buf_t &buf, pos_t buf_size, pos_t &pos, pos_t size)
Definition types.hpp:138
static string_t to_string(pos_t pos)
Definition types.hpp:78
static bool is_at_end(istream_t &stream)
Definition types.hpp:101
static char_t from_ascii(char ch)
Definition types.hpp:91
std::wostream ostream_t
Out stream type.
Definition types.hpp:67
std::vector< char_t > buf_t
Type of the buffer.
Definition types.hpp:76
std::wstring string_t
String type.
Definition types.hpp:61
static string_t from_ascii(const std::string &str)
Definition types.hpp:83
std::wistream istream_t
In stream type.
Definition types.hpp:70
std::streamoff pos_t
Type of pos in stream.
Definition types.hpp:73
static void to_begin(istream_t &stream)
Definition types.hpp:122
string_t::value_type char_t
Char type.
Definition types.hpp:64
static bool is_space(char_t ch)
Definition types.hpp:117