summaryrefslogtreecommitdiff
path: root/src/io/line.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/line.hpp')
-rw-r--r--src/io/line.hpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/io/line.hpp b/src/io/line.hpp
index a9e8944..8244c5e 100644
--- a/src/io/line.hpp
+++ b/src/io/line.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_IO_LINE_HPP
-#define TMWA_IO_LINE_HPP
+#pragma once
// io/line.hpp - Input from files, line-by-line
//
// Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,16 +18,17 @@
// 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 "../strings/rstring.hpp"
-# include "../strings/astring.hpp"
-# include "../strings/zstring.hpp"
+#include "../strings/rstring.hpp"
+#include "../strings/zstring.hpp"
+#include "../strings/literal.hpp"
-# include "fd.hpp"
-# include "read.hpp"
+#include "read.hpp"
+namespace tmwa
+{
namespace io
{
// TODO split this out
@@ -42,9 +42,9 @@ namespace io
AString message_str(ZString cat, ZString msg) const;
void message(ZString cat, ZString msg) const;
- void note(ZString msg) const { message("note", msg); }
- void warning(ZString msg) const { message("warning", msg); }
- void error(ZString msg) const { message("error", msg); }
+ void note(ZString msg) const { message("note"_s, msg); }
+ void warning(ZString msg) const { message("warning"_s, msg); }
+ void error(ZString msg) const { message("error"_s, msg); }
};
// psst, don't tell anyone
@@ -65,9 +65,9 @@ namespace io
AString message_str(ZString cat, ZString msg) const;
void message(ZString cat, ZString msg) const;
- void note(ZString msg) const { message("note", msg); }
- void warning(ZString msg) const { message("warning", msg); }
- void error(ZString msg) const { message("error", msg); }
+ void note(ZString msg) const { message("note"_s, msg); }
+ void warning(ZString msg) const { message("warning"_s, msg); }
+ void error(ZString msg) const { message("error"_s, msg); }
};
class LineReader
@@ -104,5 +104,4 @@ namespace io
bool is_open();
};
} // namespace io
-
-#endif // TMWA_IO_LINE_HPP
+} // namespace tmwa