From: <tbr...@us...> - 2012-03-20 17:14:47
|
Revision: 225 http://xmlwrapp.svn.sourceforge.net/xmlwrapp/?rev=225&view=rev Author: tbrowder2 Date: 2012-03-20 17:14:41 +0000 (Tue, 20 Mar 2012) Log Message: ----------- replace gunichar with uint32_t Modified Paths: -------------- trunk/include/xmlwrappstring/xmlwrappstring.h Modified: trunk/include/xmlwrappstring/xmlwrappstring.h =================================================================== --- trunk/include/xmlwrappstring/xmlwrappstring.h 2012-03-20 17:00:59 UTC (rev 224) +++ trunk/include/xmlwrappstring/xmlwrappstring.h 2012-03-20 17:14:41 UTC (rev 225) @@ -85,7 +85,7 @@ { public: typedef std::bidirectional_iterator_tag iterator_category; - typedef gunichar value_type; + typedef uint32_t value_type; typedef std::string::difference_type difference_type; typedef value_type reference; typedef void pointer; @@ -118,7 +118,7 @@ * but it might be useful as utility function if you prefer using * std::string even for UTF-8 encoding. */ -gunichar get_unichar_from_std_iterator(std::string::const_iterator pos) G_GNUC_PURE; +uint32_t get_unichar_from_std_iterator(std::string::const_iterator pos) G_GNUC_PURE; /** xmlws::xmlwrappstring has much the same interface as std::string, but contains @@ -199,9 +199,9 @@ typedef std::string::size_type size_type; typedef std::string::difference_type difference_type; - typedef gunichar value_type; - typedef gunichar & reference; - typedef const gunichar & const_reference; + typedef uint32_t value_type; + typedef uint32_t & reference; + typedef const uint32_t & const_reference; typedef xmlwrappstring_Iterator<std::string::iterator> iterator; typedef xmlwrappstring_Iterator<std::string::const_iterator> const_iterator; @@ -228,7 +228,7 @@ #endif /* GLIBMM_HAVE_SUN_REVERSE_ITERATOR */ -#ifdef GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS +#ifdef 1 // GLIBMM_HAVE_ALLOWS_STATIC_INLINE_NPOS static GLIBMM_API const size_type npos = std::string::npos; #else //The IRIX MipsPro compiler says "The indicated constant value is not known", @@ -284,7 +284,7 @@ * @param n Number of characters. * @param uc UCS-4 code point to use. */ - xmlwrappstring(size_type n, gunichar uc); + xmlwrappstring(size_type n, uint32_t uc); /*! Construct a xmlwrappstring as multiple characters. * @param n Number of characters. @@ -304,14 +304,14 @@ xmlwrappstring& operator=(const std::string& src); xmlwrappstring& operator=(const char* src); - xmlwrappstring& operator=(gunichar uc); + xmlwrappstring& operator=(uint32_t uc); xmlwrappstring& operator=(char c); xmlwrappstring& assign(const xmlwrappstring& src); xmlwrappstring& assign(const xmlwrappstring& src, size_type i, size_type n); xmlwrappstring& assign(const char* src, size_type n); xmlwrappstring& assign(const char* src); - xmlwrappstring& assign(size_type n, gunichar uc); + xmlwrappstring& assign(size_type n, uint32_t uc); xmlwrappstring& assign(size_type n, char c); template <class In> xmlwrappstring& assign(In pbegin, In pend); @@ -321,16 +321,16 @@ xmlwrappstring& operator+=(const xmlwrappstring& src); xmlwrappstring& operator+=(const char* src); - xmlwrappstring& operator+=(gunichar uc); + xmlwrappstring& operator+=(uint32_t uc); xmlwrappstring& operator+=(char c); - void push_back(gunichar uc); + void push_back(uint32_t uc); void push_back(char c); xmlwrappstring& append(const xmlwrappstring& src); xmlwrappstring& append(const xmlwrappstring& src, size_type i, size_type n); xmlwrappstring& append(const char* src, size_type n); xmlwrappstring& append(const char* src); - xmlwrappstring& append(size_type n, gunichar uc); + xmlwrappstring& append(size_type n, uint32_t uc); xmlwrappstring& append(size_type n, char c); template <class In> xmlwrappstring& append(In pbegin, In pend); @@ -342,12 +342,12 @@ xmlwrappstring& insert(size_type i, const xmlwrappstring& src, size_type i2, size_type n); xmlwrappstring& insert(size_type i, const char* src, size_type n); xmlwrappstring& insert(size_type i, const char* src); - xmlwrappstring& insert(size_type i, size_type n, gunichar uc); + xmlwrappstring& insert(size_type i, size_type n, uint32_t uc); xmlwrappstring& insert(size_type i, size_type n, char c); - iterator insert(iterator p, gunichar uc); + iterator insert(iterator p, uint32_t uc); iterator insert(iterator p, char c); - void insert(iterator p, size_type n, gunichar uc); + void insert(iterator p, size_type n, uint32_t uc); void insert(iterator p, size_type n, char c); template <class In> void insert(iterator p, In pbegin, In pend); @@ -359,13 +359,13 @@ xmlwrappstring& replace(size_type i, size_type n, const xmlwrappstring& src, size_type i2, size_type n2); xmlwrappstring& replace(size_type i, size_type n, const char* src, size_type n2); xmlwrappstring& replace(size_type i, size_type n, const char* src); - xmlwrappstring& replace(size_type i, size_type n, size_type n2, gunichar uc); + xmlwrappstring& replace(size_type i, size_type n, size_type n2, uint32_t uc); xmlwrappstring& replace(size_type i, size_type n, size_type n2, char c); xmlwrappstring& replace(iterator pbegin, iterator pend, const xmlwrappstring& src); xmlwrappstring& replace(iterator pbegin, iterator pend, const char* src, size_type n); xmlwrappstring& replace(iterator pbegin, iterator pend, const char* src); - xmlwrappstring& replace(iterator pbegin, iterator pend, size_type n, gunichar uc); + xmlwrappstring& replace(iterator pbegin, iterator pend, size_type n, uint32_t uc); xmlwrappstring& replace(iterator pbegin, iterator pend, size_type n, char c); template <class In> xmlwrappstring& replace(iterator pbegin, iterator pend, In pbegin2, In pend2); @@ -442,13 +442,13 @@ size_type find(const xmlwrappstring& str, size_type i=0) const; size_type find(const char* str, size_type i, size_type n) const; size_type find(const char* str, size_type i=0) const; - size_type find(gunichar uc, size_type i=0) const; + size_type find(uint32_t uc, size_type i=0) const; size_type find(char c, size_type i=0) const; size_type rfind(const xmlwrappstring& str, size_type i=npos) const; size_type rfind(const char* str, size_type i, size_type n) const; size_type rfind(const char* str, size_type i=npos) const; - size_type rfind(gunichar uc, size_type i=npos) const; + size_type rfind(uint32_t uc, size_type i=npos) const; size_type rfind(char c, size_type i=npos) const; //! @} @@ -458,25 +458,25 @@ size_type find_first_of(const xmlwrappstring& match, size_type i=0) const; size_type find_first_of(const char* match, size_type i, size_type n) const; size_type find_first_of(const char* match, size_type i=0) const; - size_type find_first_of(gunichar uc, size_type i=0) const; + size_type find_first_of(uint32_t uc, size_type i=0) const; size_type find_first_of(char c, size_type i=0) const; size_type find_last_of(const xmlwrappstring& match, size_type i=npos) const; size_type find_last_of(const char* match, size_type i, size_type n) const; size_type find_last_of(const char* match, size_type i=npos) const; - size_type find_last_of(gunichar uc, size_type i=npos) const; + size_type find_last_of(uint32_t uc, size_type i=npos) const; size_type find_last_of(char c, size_type i=npos) const; size_type find_first_not_of(const xmlwrappstring& match, size_type i=0) const; size_type find_first_not_of(const char* match, size_type i, size_type n) const; size_type find_first_not_of(const char* match, size_type i=0) const; - size_type find_first_not_of(gunichar uc, size_type i=0) const; + size_type find_first_not_of(uint32_t uc, size_type i=0) const; size_type find_first_not_of(char c, size_type i=0) const; size_type find_last_not_of(const xmlwrappstring& match, size_type i=npos) const; size_type find_last_not_of(const char* match, size_type i, size_type n) const; size_type find_last_not_of(const char* match, size_type i=npos) const; - size_type find_last_not_of(gunichar uc, size_type i=npos) const; + size_type find_last_not_of(uint32_t uc, size_type i=npos) const; size_type find_last_not_of(char c, size_type i=npos) const; //! @} @@ -512,7 +512,7 @@ //! @name Change the string's size. //! @{ - void resize(size_type n, gunichar uc); + void resize(size_type n, uint32_t uc); void resize(size_type n, char c='\0'); //! @} @@ -806,7 +806,7 @@ //The Tru64 compiler needs these partial specializations to be declared here, //as well as defined later. That's probably correct. murrayc. template <class In> struct SequenceToString<In, char>; - template <class In> struct SequenceToString<In, gunichar>; + template <class In> struct SequenceToString<In, uint32_t>; template <class T> class Stringify; class FormatStream; @@ -832,19 +832,19 @@ }; template <class In> -struct xmlwrappstring::SequenceToString<In, gunichar> : public std::string +struct xmlwrappstring::SequenceToString<In, uint32_t> : public std::string { SequenceToString(In pbegin, In pend); }; template <> -struct xmlwrappstring::SequenceToString<xmlws::xmlwrappstring::iterator, gunichar> : public std::string +struct xmlwrappstring::SequenceToString<xmlws::xmlwrappstring::iterator, uint32_t> : public std::string { SequenceToString(xmlws::xmlwrappstring::iterator pbegin, xmlws::xmlwrappstring::iterator pend); }; template <> -struct xmlwrappstring::SequenceToString<xmlws::xmlwrappstring::const_iterator, gunichar> : public std::string +struct xmlwrappstring::SequenceToString<xmlws::xmlwrappstring::const_iterator, uint32_t> : public std::string { SequenceToString(xmlws::xmlwrappstring::const_iterator pbegin, xmlws::xmlwrappstring::const_iterator pend); }; @@ -1033,7 +1033,7 @@ {} template <class In> -xmlwrappstring::SequenceToString<In,gunichar>::SequenceToString(In pbegin, In pend) +xmlwrappstring::SequenceToString<In,uint32_t>::SequenceToString(In pbegin, In pend) { char utf8_buf[6]; // stores a single UTF-8 character @@ -1573,7 +1573,7 @@ } /** @relates xmlws::xmlwrappstring */ -inline xmlwrappstring operator+(const xmlwrappstring& lhs, gunichar rhs) +inline xmlwrappstring operator+(const xmlwrappstring& lhs, uint32_t rhs) { xmlwrappstring temp(lhs); temp += rhs; @@ -1581,7 +1581,7 @@ } /** @relates xmlws::xmlwrappstring */ -inline xmlwrappstring operator+(gunichar lhs, const xmlwrappstring& rhs) +inline xmlwrappstring operator+(uint32_t lhs, const xmlwrappstring& rhs) { xmlwrappstring temp(1, lhs); temp += rhs; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |