diff options
Diffstat (limited to 'src/strings/astring.hpp')
-rw-r--r-- | src/strings/astring.hpp | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/src/strings/astring.hpp b/src/strings/astring.hpp index aab14cf..83399f0 100644 --- a/src/strings/astring.hpp +++ b/src/strings/astring.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_STRINGS_ASTRING_HPP -#define TMWA_STRINGS_ASTRING_HPP +#pragma once // strings/astring.hpp - An owned, reference-counted immutable string. // // Copyright © 2013-2014 Ben Longbons <b.r.longbons@gmail.com> @@ -19,20 +18,23 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -# include "../sanity.hpp" +#include "fwd.hpp" -# include <cstdarg> -# include <cstring> +#include "base.hpp" +#include "rstring.hpp" -# include "base.hpp" -# include "rstring.hpp" +namespace tmwa +{ namespace strings { /// An owning string that has reached its final contents. /// The storage is NUL-terminated class AString : public _crtp_string<AString, AString, ZPair> { +#ifdef __clang__ + __attribute__((unused)) +#endif RString *align[0]; char data[255]; unsigned char special; @@ -49,12 +51,6 @@ namespace strings explicit AString(const MString& s); - template<size_t n> - AString(char (&s)[n]) = delete; - - template<size_t n> - AString(const char (&s)[n]); - template<class It> AString(It b, It e); @@ -66,6 +62,7 @@ namespace strings AString(XString); template<uint8_t n> AString(const VString<n>& v); + AString(LString s); iterator begin() const; iterator end() const; @@ -81,20 +78,7 @@ namespace strings __attribute__((format(printf, 2, 0))) int do_vprint(AString& out, const char *fmt, va_list ap); - - class AStringConverter - { - AString& out; - char *mid; - public: - AStringConverter(AString& s); - ~AStringConverter(); - char **operator &(); - }; - - AStringConverter convert_for_scanf(AString& s); } // namespace strings +} // namespace tmwa -# include "astring.tcc" - -#endif // TMWA_STRINGS_ASTRING_HPP +#include "astring.tcc" |