From c812c92d1a1835f0bda783e709481188c8d92225 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Sat, 15 Mar 2014 19:34:59 -0700 Subject: Clean up header organization --- src/strings/astring.cpp | 2 ++ src/strings/base.hpp | 2 ++ src/strings/fwd.hpp | 2 ++ src/strings/mstring.cpp | 2 ++ src/strings/rstring.cpp | 2 ++ src/strings/sstring.cpp | 2 ++ src/strings/tstring.cpp | 2 ++ src/strings/vstring.cpp | 2 ++ src/strings/vstring.hpp | 8 ++++++++ src/strings/vstring.tcc | 2 +- src/strings/xstring.cpp | 2 ++ src/strings/zstring.cpp | 2 ++ 12 files changed, 29 insertions(+), 1 deletion(-) (limited to 'src/strings') diff --git a/src/strings/astring.cpp b/src/strings/astring.cpp index f7cfa2e..f1e9030 100644 --- a/src/strings/astring.cpp +++ b/src/strings/astring.cpp @@ -25,6 +25,8 @@ #include "xstring.hpp" #include "vstring.hpp" +//#include "../poison.hpp" + namespace strings { static_assert(sizeof(AString) == 256, "AString"); diff --git a/src/strings/base.hpp b/src/strings/base.hpp index c081f70..cd8d46f 100644 --- a/src/strings/base.hpp +++ b/src/strings/base.hpp @@ -22,6 +22,8 @@ # include "fwd.hpp" # include "pair.hpp" +# include + # include // It is a common mistake to assume that one string class for everything. diff --git a/src/strings/fwd.hpp b/src/strings/fwd.hpp index f2b4037..4c58e03 100644 --- a/src/strings/fwd.hpp +++ b/src/strings/fwd.hpp @@ -21,6 +21,8 @@ # include "../sanity.hpp" +# include + // It is a common mistake to assume that one string class for everything. // Because C++ and TMWA have a C legacy, there are a few more here // than would probably be necessary in an ideal language. diff --git a/src/strings/mstring.cpp b/src/strings/mstring.cpp index 0d496a5..2a1ca62 100644 --- a/src/strings/mstring.cpp +++ b/src/strings/mstring.cpp @@ -20,6 +20,8 @@ #include "xstring.hpp" +#include "../poison.hpp" + namespace strings { MString::iterator MString::begin() diff --git a/src/strings/rstring.cpp b/src/strings/rstring.cpp index eb9d88a..c0e231e 100644 --- a/src/strings/rstring.cpp +++ b/src/strings/rstring.cpp @@ -25,6 +25,8 @@ #include "xstring.hpp" #include "vstring.hpp" +//#include "../poison.hpp" + namespace strings { static_assert(sizeof(RString) == sizeof(const char *), "RString"); diff --git a/src/strings/sstring.cpp b/src/strings/sstring.cpp index fee98f9..76f0994 100644 --- a/src/strings/sstring.cpp +++ b/src/strings/sstring.cpp @@ -22,6 +22,8 @@ #include "zstring.hpp" #include "xstring.hpp" +#include "../poison.hpp" + namespace strings { SString::SString() diff --git a/src/strings/tstring.cpp b/src/strings/tstring.cpp index 8be7112..5f463ca 100644 --- a/src/strings/tstring.cpp +++ b/src/strings/tstring.cpp @@ -22,6 +22,8 @@ #include "zstring.hpp" #include "xstring.hpp" +#include "../poison.hpp" + namespace strings { TString::TString() diff --git a/src/strings/vstring.cpp b/src/strings/vstring.cpp index 6a0416a..0ef8f3d 100644 --- a/src/strings/vstring.cpp +++ b/src/strings/vstring.cpp @@ -18,6 +18,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#include "../poison.hpp" + namespace strings { } // namespace strings diff --git a/src/strings/vstring.hpp b/src/strings/vstring.hpp index 183e782..c467b64 100644 --- a/src/strings/vstring.hpp +++ b/src/strings/vstring.hpp @@ -65,6 +65,14 @@ namespace strings int do_vprint(VString& out, const char *fmt, va_list ap); } // namespace strings +template +T stringish(VString iv) +{ + T rv; + static_cast&>(rv) = iv; + return rv; +} + # include "vstring.tcc" #endif // TMWA_STRINGS_VSTRING_HPP diff --git a/src/strings/vstring.tcc b/src/strings/vstring.tcc index 69729d4..1aa163d 100644 --- a/src/strings/vstring.tcc +++ b/src/strings/vstring.tcc @@ -19,7 +19,7 @@ #include -#include "../common/utils2.hpp" +#include "../compat/cast.hpp" #include "rstring.hpp" #include "astring.hpp" diff --git a/src/strings/xstring.cpp b/src/strings/xstring.cpp index 8a604c7..0808104 100644 --- a/src/strings/xstring.cpp +++ b/src/strings/xstring.cpp @@ -18,6 +18,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +#include "../poison.hpp" + namespace strings { XString::XString() diff --git a/src/strings/zstring.cpp b/src/strings/zstring.cpp index bfc0c96..e2a763f 100644 --- a/src/strings/zstring.cpp +++ b/src/strings/zstring.cpp @@ -20,6 +20,8 @@ #include "xstring.hpp" +#include "../poison.hpp" + namespace strings { ZString::ZString() -- cgit v1.2.3-70-g09d2