summaryrefslogtreecommitdiff
path: root/src/strings
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-06-27 19:16:45 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-06-27 19:33:42 -0700
commit7af4c5b5c561362cb1135ab504095ae667a9270a (patch)
tree49ffd3008d7634ba36f3951493a68e928407ce89 /src/strings
parent8d7f1dadeeb1dc1609b72de5a4ee3a5247b0e9e6 (diff)
downloadtmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.gz
tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.bz2
tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.xz
tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.zip
This is more reliable
Diffstat (limited to 'src/strings')
-rw-r--r--src/strings/all.hpp27
-rw-r--r--src/strings/astring.hpp17
-rw-r--r--src/strings/base.hpp15
-rw-r--r--src/strings/fwd.hpp11
-rw-r--r--src/strings/literal.hpp9
-rw-r--r--src/strings/mstring.hpp9
-rw-r--r--src/strings/pair.hpp7
-rw-r--r--src/strings/rstring.hpp13
-rw-r--r--src/strings/sstring.hpp13
-rw-r--r--src/strings/tstring.hpp13
-rw-r--r--src/strings/vstring.hpp13
-rw-r--r--src/strings/xstring.hpp11
-rw-r--r--src/strings/zstring.hpp11
13 files changed, 65 insertions, 104 deletions
diff --git a/src/strings/all.hpp b/src/strings/all.hpp
index 9311ba4..8e13b92 100644
--- a/src/strings/all.hpp
+++ b/src/strings/all.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_ALL_HPP
-#define TMWA_STRINGS_ALL_HPP
+#pragma once
// strings/all.hpp - All the string classes you'll ever need.
//
// Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,22 +18,20 @@
// 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 "fwd.hpp"
+#include "fwd.hpp"
-# include "base.hpp"
-# include "mstring.hpp"
-# include "rstring.hpp"
-# include "astring.hpp"
-# include "tstring.hpp"
-# include "sstring.hpp"
-# include "zstring.hpp"
-# include "xstring.hpp"
-# include "literal.hpp"
-# include "vstring.hpp"
+#include "base.hpp"
+#include "mstring.hpp"
+#include "rstring.hpp"
+#include "astring.hpp"
+#include "tstring.hpp"
+#include "sstring.hpp"
+#include "zstring.hpp"
+#include "xstring.hpp"
+#include "literal.hpp"
+#include "vstring.hpp"
namespace tmwa
{
} // namespace tmwa
-
-#endif // TMWA_STRINGS_ALL_HPP
diff --git a/src/strings/astring.hpp b/src/strings/astring.hpp
index cf33cc5..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,10 +18,10 @@
// 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 "fwd.hpp"
+#include "fwd.hpp"
-# include "base.hpp"
-# include "rstring.hpp"
+#include "base.hpp"
+#include "rstring.hpp"
namespace tmwa
@@ -33,9 +32,9 @@ namespace strings
/// The storage is NUL-terminated
class AString : public _crtp_string<AString, AString, ZPair>
{
-# ifdef __clang__
+#ifdef __clang__
__attribute__((unused))
-# endif
+#endif
RString *align[0];
char data[255];
unsigned char special;
@@ -82,6 +81,4 @@ namespace strings
} // namespace strings
} // namespace tmwa
-# include "astring.tcc"
-
-#endif // TMWA_STRINGS_ASTRING_HPP
+#include "astring.tcc"
diff --git a/src/strings/base.hpp b/src/strings/base.hpp
index 122d46d..b6b3df0 100644
--- a/src/strings/base.hpp
+++ b/src/strings/base.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_BASE_HPP
-#define TMWA_STRINGS_BASE_HPP
+#pragma once
// strings/base.hpp - CRTP base for string implementations.
//
// Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,12 +18,12 @@
// 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 "fwd.hpp"
-# include "pair.hpp"
+#include "fwd.hpp"
+#include "pair.hpp"
-# include <cstddef>
+#include <cstddef>
-# include <iterator>
+#include <iterator>
namespace tmwa
@@ -200,6 +199,4 @@ namespace strings
} // namespace strings
} // namespace tmwa
-# include "base.tcc"
-
-#endif // TMWA_STRINGS_BASE_HPP
+#include "base.tcc"
diff --git a/src/strings/fwd.hpp b/src/strings/fwd.hpp
index 4f1fe89..b1b8266 100644
--- a/src/strings/fwd.hpp
+++ b/src/strings/fwd.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_FWD_HPP
-#define TMWA_STRINGS_FWD_HPP
+#pragma once
// strings/fwd.hpp - Forward declarations for all the string classes.
//
// Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,10 +18,10 @@
// 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 "../sanity.hpp"
-# include <cstddef>
-# include <cstdint>
+#include <cstddef>
+#include <cstdint>
namespace tmwa
@@ -74,5 +73,3 @@ using strings::VString;
using strings::operator "" _s;
using strings::operator "" _fmt;
} // namespace tmwa
-
-#endif // TMWA_STRINGS_FWD_HPP
diff --git a/src/strings/literal.hpp b/src/strings/literal.hpp
index 207ccff..5e27a9f 100644
--- a/src/strings/literal.hpp
+++ b/src/strings/literal.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_LITERAL_HPP
-#define TMWA_STRINGS_LITERAL_HPP
+#pragma once
// strings/literal.hpp - A string stored in the readonly data segment.
//
// Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,9 +18,9 @@
// 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 "fwd.hpp"
+#include "fwd.hpp"
-# include "base.hpp"
+#include "base.hpp"
namespace tmwa
@@ -77,5 +76,3 @@ namespace strings
}
} // namespace strings
} // namespace tmwa
-
-#endif // TMWA_STRINGS_LSTRING_HPP
diff --git a/src/strings/mstring.hpp b/src/strings/mstring.hpp
index b1ecce3..4f40919 100644
--- a/src/strings/mstring.hpp
+++ b/src/strings/mstring.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_MSTRING_HPP
-#define TMWA_STRINGS_MSTRING_HPP
+#pragma once
// strings/mstring.hpp - A mutable string.
//
// Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,9 +18,9 @@
// 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 "fwd.hpp"
+#include "fwd.hpp"
-# include <deque>
+#include <deque>
namespace tmwa
@@ -66,5 +65,3 @@ namespace strings
};
} // namespace strings
} // namespace tmwa
-
-#endif // TMWA_STRINGS_MSTRING_HPP
diff --git a/src/strings/pair.hpp b/src/strings/pair.hpp
index e249d9e..9c1cd9f 100644
--- a/src/strings/pair.hpp
+++ b/src/strings/pair.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_PAIR_HPP
-#define TMWA_STRINGS_PAIR_HPP
+#pragma once
// strings/pair.hpp - Internal contiguous range.
//
// Copyright © 2013-2014 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,7 +18,7 @@
// 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 "fwd.hpp"
+#include "fwd.hpp"
namespace tmwa
@@ -64,5 +63,3 @@ namespace strings
};
} // namespace strings
} // namespace tmwa
-
-#endif // TMWA_STRINGS_PAIR_HPP
diff --git a/src/strings/rstring.hpp b/src/strings/rstring.hpp
index c656622..fd3ee65 100644
--- a/src/strings/rstring.hpp
+++ b/src/strings/rstring.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_RSTRING_HPP
-#define TMWA_STRINGS_RSTRING_HPP
+#pragma once
// strings/rstring.hpp - An owned, reference-counted immutable string.
//
// Copyright © 2013-2014 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,11 +18,11 @@
// 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 "fwd.hpp"
+#include "fwd.hpp"
-# include <cstdarg>
+#include <cstdarg>
-# include "base.hpp"
+#include "base.hpp"
namespace tmwa
@@ -88,6 +87,4 @@ namespace strings
} // namespace strings
} // namespace tmwa
-# include "rstring.tcc"
-
-#endif // TMWA_STRINGS_RSTRING_HPP
+#include "rstring.tcc"
diff --git a/src/strings/sstring.hpp b/src/strings/sstring.hpp
index 5c5a2f5..a65616d 100644
--- a/src/strings/sstring.hpp
+++ b/src/strings/sstring.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_SSTRING_HPP
-#define TMWA_STRINGS_SSTRING_HPP
+#pragma once
// strings/sstring.hpp - A full slice of an RString.
//
// Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,10 +18,10 @@
// 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 "fwd.hpp"
+#include "fwd.hpp"
-# include "base.hpp"
-# include "rstring.hpp"
+#include "base.hpp"
+#include "rstring.hpp"
namespace tmwa
@@ -59,6 +58,4 @@ namespace strings
} // namespace strings
} // namespace tmwa
-# include "sstring.tcc"
-
-#endif // TMWA_STRINGS_SSTRING_HPP
+#include "sstring.tcc"
diff --git a/src/strings/tstring.hpp b/src/strings/tstring.hpp
index 054ce69..b0da566 100644
--- a/src/strings/tstring.hpp
+++ b/src/strings/tstring.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_TSTRING_HPP
-#define TMWA_STRINGS_TSTRING_HPP
+#pragma once
// strings/tstring.hpp - A tail slice of a string.
//
// Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,10 +18,10 @@
// 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 "fwd.hpp"
+#include "fwd.hpp"
-# include "base.hpp"
-# include "rstring.hpp"
+#include "base.hpp"
+#include "rstring.hpp"
namespace tmwa
@@ -65,6 +64,4 @@ namespace strings
} // namespace strings
} // namespace tmwa
-# include "tstring.tcc"
-
-#endif // TMWA_STRINGS_TSTRING_HPP
+#include "tstring.tcc"
diff --git a/src/strings/vstring.hpp b/src/strings/vstring.hpp
index 25051c8..f3437a5 100644
--- a/src/strings/vstring.hpp
+++ b/src/strings/vstring.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_VSTRING_HPP
-#define TMWA_STRINGS_VSTRING_HPP
+#pragma once
// strings/vstring.hpp - A small string that stores its own value.
//
// Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,11 +18,11 @@
// 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 "fwd.hpp"
+#include "fwd.hpp"
-# include <cstdio>
+#include <cstdio>
-# include "base.hpp"
+#include "base.hpp"
namespace tmwa
@@ -78,6 +77,4 @@ T stringish(VString<sizeof(T) - 1> iv)
}
} // namespace tmwa
-# include "vstring.tcc"
-
-#endif // TMWA_STRINGS_VSTRING_HPP
+#include "vstring.tcc"
diff --git a/src/strings/xstring.hpp b/src/strings/xstring.hpp
index 0de2be3..2b000c4 100644
--- a/src/strings/xstring.hpp
+++ b/src/strings/xstring.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_XSTRING_HPP
-#define TMWA_STRINGS_XSTRING_HPP
+#pragma once
// strings/xstring.hpp - A full borrowed slice.
//
// Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,9 +18,9 @@
// 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 "fwd.hpp"
+#include "fwd.hpp"
-# include "base.hpp"
+#include "base.hpp"
namespace tmwa
@@ -60,6 +59,4 @@ namespace strings
} // namespace strings
} // namespace tmwa
-# include "xstring.tcc"
-
-#endif // TMWA_STRINGS_XSTRING_HPP
+#include "xstring.tcc"
diff --git a/src/strings/zstring.hpp b/src/strings/zstring.hpp
index e82c9fb..1e38662 100644
--- a/src/strings/zstring.hpp
+++ b/src/strings/zstring.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_STRINGS_ZSTRING_HPP
-#define TMWA_STRINGS_ZSTRING_HPP
+#pragma once
// strings/zstring.hpp - A borrowed tail slice of a string.
//
// Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,9 +18,9 @@
// 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 "fwd.hpp"
+#include "fwd.hpp"
-# include "base.hpp"
+#include "base.hpp"
namespace tmwa
@@ -65,6 +64,4 @@ namespace strings
} // namespace strings
} // namespace tmwa
-# include "zstring.tcc"
-
-#endif // TMWA_STRINGS_ZSTRING_HPP
+#include "zstring.tcc"