diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-28 20:56:12 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-02-28 20:56:12 (GMT) |
commit | 107d84ae68208f51b524c2f0b933784a26d23ad3 (patch) | |
tree | 75245596f6a2a242b60d12c108faa92b964163cc /addon | |
parent | 5e683eb0f019fbce9cf439b8c88eeec6254375c1 (diff) | |
download | Doxygen-107d84ae68208f51b524c2f0b933784a26d23ad3.zip Doxygen-107d84ae68208f51b524c2f0b933784a26d23ad3.tar.gz Doxygen-107d84ae68208f51b524c2f0b933784a26d23ad3.tar.bz2 |
Fix a few compiler warnings in the Linux build
Diffstat (limited to 'addon')
-rw-r--r-- | addon/doxmlparser/src/stringimpl.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/addon/doxmlparser/src/stringimpl.h b/addon/doxmlparser/src/stringimpl.h index 013858f..8931b42 100644 --- a/addon/doxmlparser/src/stringimpl.h +++ b/addon/doxmlparser/src/stringimpl.h @@ -4,26 +4,34 @@ #include <qstring.h> #include "doxmlintf.h" -class StringImpl : public QString, public IString +class StringImpl : public IString { public: StringImpl() {} - StringImpl(const QString &str) : QString(str) {} + StringImpl(const QString &str) : m_str(str) {} StringImpl &operator=(const QString &str) - { QString::operator=(str); return *this; } + { m_str=str; return *this; } virtual ~StringImpl() {} + const char *data() const + { return m_str.data(); } // IString const char *latin1() const - { return QString::latin1(); } + { return m_str.latin1(); } const char *utf8() const - { return QString::utf8(); } + { m_cstr = m_str.utf8(); return m_cstr.data(); } unsigned short unicodeCharAt(int index) const - { return QString::unicode()[index].unicode(); } + { return m_str.unicode()[index].unicode(); } bool isEmpty() const - { return QString::isEmpty(); } + { return m_str.isEmpty(); } int length() const - { return QString::length(); } + { return m_str.length(); } + + operator QString() const { return m_str; } + + private: + QString m_str; + mutable QCString m_cstr; // used as a cache for m_str.utf8() to avoid returning a temporary }; #endif |