diff options
Diffstat (limited to 'src/lib/netlist/plib/pstring.h')
-rw-r--r-- | src/lib/netlist/plib/pstring.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/netlist/plib/pstring.h b/src/lib/netlist/plib/pstring.h index 2490186566e..df4d79d587f 100644 --- a/src/lib/netlist/plib/pstring.h +++ b/src/lib/netlist/plib/pstring.h @@ -60,6 +60,7 @@ public: // construction with copy pstring_t(const mem_t *string) {init(); if (string != nullptr && *string != 0) pcopy(string); } pstring_t(const pstring_t &string) {init(); pcopy(string); } + pstring_t(pstring_t &&string) : m_ptr(string.m_ptr) {string.m_ptr = nullptr; } // assignment operators pstring_t &operator=(const mem_t *string) { pcopy(string); return *this; } @@ -115,7 +116,7 @@ public: unsigned len() const { - return F::len(m_ptr); + return traits::len(m_ptr); } pstring_t& operator+=(const code_t c) { mem_t buf[F::MAXCODELEN+1] = { 0 }; F::encode(c, buf); pcat(buf); return *this; } @@ -295,6 +296,8 @@ struct putf8_traits } }; +// FIXME: "using pstring = pstring_t<putf8_traits>" is not understood by eclipse + struct pstring : public pstring_t<putf8_traits> { public: @@ -357,6 +360,8 @@ public: void cat(const char *s) { pcat(s); } void cat(const void *m, unsigned l) { pcat(m, l); } + void clear() { m_len = 0; *m_ptr = 0; } + private: void init() |