Go to the documentation of this file.
92 virtual const char*
what()
const throw() {
return (
const char*)message.
get();}
94 message(g_strdup_printf(
"Utf8::ConversionError: %s", msg)) {}
96 message(g_strdup_printf(
"Utf8::ConversionError: %s", error->message)) {}
306 return g_utf8_validate(text.data(), text.size(), 0);
389 class ReverseIterator;
400 std::string::const_iterator pos;
501 std::string::const_iterator
base()
const {
return pos;}
516 Iterator(
const std::string::const_iterator& iter): pos(iter) {}
531 Iterator(
const std::string::iterator& iter): pos(iter) {}
564 const std::string::value_type* tmp = &(*pos);
568 pos += g_utf8_next_char(tmp) - tmp;
581 const std::string::value_type* tmp = &(*(pos-1));
583 pos -= tmp - g_utf8_prev_char(tmp);
599 return (iter1.
base() == iter2.
base());
608 return (iter1.
base() != iter2.
base());
617 return (iter1.
base() < iter2.
base());
626 return (iter1.
base() <= iter2.
base());
635 return (iter1.
base() > iter2.
base());
644 return (iter1.
base() >= iter2.
base());
706 std::string::const_iterator pos;
708 mutable std::string::const_iterator cache;
821 std::string::const_iterator
base()
const {
return pos;}
886 if (pos > cache) pos = cache;
891 const std::string::value_type* tmp = &(*(pos-1));
893 pos -= tmp - g_utf8_prev_char(tmp);
906 const std::string::value_type* tmp = &(*pos);
910 pos += g_utf8_next_char(tmp) - tmp;
924 return g_utf8_get_char(&(*(tmp.base())));
933 return (iter1.
base() == iter2.
base());
942 return (iter1.
base() != iter2.
base());
954 return (iter1.
base() > iter2.
base());
966 return (iter1.
base() >= iter2.
base());
978 return (iter1.
base() < iter2.
base());
990 return (iter1.
base() <= iter2.
base());
gunichar reference
Definition: convert.h:700
bool operator>=(const Iterator &iter1, const Iterator &iter2)
Definition: convert.h:643
ReverseIterator(const std::string::reverse_iterator &iter)
Definition: convert.h:851
std::string wide_to_utf8(const std::wstring &input)
std::string::const_iterator base() const
Definition: convert.h:821
Definition: application.h:44
ReverseIterator & operator=(const Iterator &iter)
Definition: convert.h:800
std::u32string utf32_from_utf8(const std::string &input)
gunichar reference
Definition: convert.h:394
~ConversionError()
Definition: convert.h:97
ReverseIterator & operator=(const std::string::reverse_iterator &iter)
Definition: convert.h:777
T get() const noexcept
Definition: shared_handle.h:765
ConversionError(const char *msg)
Definition: convert.h:93
Iterator(const Iterator &iter)
Definition: convert.h:540
Iterator()
Definition: convert.h:556
std::string::difference_type difference_type
Definition: convert.h:702
ReverseIterator(const std::string::const_reverse_iterator &iter)
Definition: convert.h:836
bool validate(const std::string &text)
Definition: convert.h:305
A class which will iterate in reverse through a std::string object by reference to unicode characters...
Definition: convert.h:697
std::string locale_from_utf8(const std::string &input)
std::string locale_to_utf8(const std::string &input)
ReverseIterator & operator=(const std::string::const_reverse_iterator &iter)
Definition: convert.h:765
ReverseIterator & operator--()
Definition: convert.h:904
bool operator==(const Iterator &iter1, const Iterator &iter2)
Definition: convert.h:598
void pointer
Definition: convert.h:395
Iterator & operator=(const std::string::const_iterator &iter)
Definition: convert.h:449
ReverseIterator(const ReverseIterator &iter)
Definition: convert.h:860
bool operator<(const Iterator &iter1, const Iterator &iter2)
Definition: convert.h:616
Iterator & operator=(const Iterator &iter)
Definition: convert.h:471
std::string::difference_type difference_type
Definition: convert.h:396
std::wstring wide_from_utf8(const std::string &input)
Iterator(const std::string::const_iterator &iter)
Definition: convert.h:516
Iterator::value_type operator*() const
Definition: convert.h:491
std::string utf32_to_utf8(const std::u32string &input)
ReverseIterator & operator=(const ReverseIterator &iter)
Definition: convert.h:787
std::string uniwide_to_utf8(const std::wstring &input)
ReverseIterator::value_type operator*() const
Definition: convert.h:920
#define CGU_GLIB_MEMORY_SLICES_FUNCS
Definition: cgu_config.h:84
std::bidirectional_iterator_tag iterator_category
Definition: convert.h:703
std::string utf16_to_utf8(const std::u16string &input)
ReverseIterator()
Definition: convert.h:877
gunichar value_type
Definition: convert.h:699
Iterator & operator++()
Definition: convert.h:563
ReverseIterator(const Iterator &iter)
Definition: convert.h:872
bool operator>(const Iterator &iter1, const Iterator &iter2)
Definition: convert.h:634
std::string::const_iterator base() const
Definition: convert.h:501
std::string filename_to_utf8(const std::string &input)
bool operator<=(const Iterator &iter1, const Iterator &iter2)
Definition: convert.h:625
gunichar value_type
Definition: convert.h:393
ConversionError(GError *error)
Definition: convert.h:95
std::string filename_from_utf8(const std::string &input)
bool operator!=(const Iterator &iter1, const Iterator &iter2)
Definition: convert.h:607
std::wstring uniwide_from_utf8(const std::string &input)
A class which will iterate through a std::string object by reference to unicode characters rather tha...
Definition: convert.h:391
virtual const char * what() const
Definition: convert.h:92
std::bidirectional_iterator_tag iterator_category
Definition: convert.h:397
Iterator & operator=(const std::string::iterator &iter)
Definition: convert.h:461
ReverseIterator & operator++()
Definition: convert.h:884
Iterator(const std::string::iterator &iter)
Definition: convert.h:531
void pointer
Definition: convert.h:701
std::u16string utf16_from_utf8(const std::string &input)
Iterator & operator--()
Definition: convert.h:578