aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/client/input.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'client/input.hpp')
-rw-r--r--client/input.hpp28
1 files changed, 8 insertions, 20 deletions
diff --git a/client/input.hpp b/client/input.hpp
index 9c22b03..0295f3b 100644
--- a/client/input.hpp
+++ b/client/input.hpp
@@ -19,14 +19,12 @@ namespace math::client::input {
class Error : public client::Error {
public:
- explicit Error(const std::string& what)
- : client::Error{"input error: " + what} {
- }
+ explicit Error(const std::string& what) : client::Error{"input error: " + what} {}
};
class Reader {
public:
- using InputHandler = std::function<bool (const std::string&)>;
+ using InputHandler = std::function<bool(const std::string&)>;
virtual ~Reader() = default;
@@ -37,13 +35,9 @@ using ReaderPtr = std::unique_ptr<input::Reader>;
class FileReader : public Reader {
public:
- explicit FileReader(const std::string& path)
- : m_path{path}
- { }
+ explicit FileReader(const std::string& path) : m_path{path} {}
- bool for_each_input(const InputHandler& process) const override {
- return enum_lines(process);
- }
+ bool for_each_input(const InputHandler& process) const override { return enum_lines(process); }
private:
bool enum_lines(const InputHandler& process) const {
@@ -73,9 +67,7 @@ private:
class MultiFileReader : public Reader {
public:
- explicit MultiFileReader(const std::vector<std::string>& paths)
- : m_paths{paths}
- { }
+ explicit MultiFileReader(const std::vector<std::string>& paths) : m_paths{paths} {}
bool for_each_input(const InputHandler& process) const override {
for (const auto& path : m_paths) {
@@ -101,13 +93,9 @@ inline input::ReaderPtr make_file_reader(const std::vector<std::string>& paths)
class StringReader : public Reader {
public:
- explicit StringReader(const std::string& input)
- : m_input{input}
- { }
+ explicit StringReader(const std::string& input) : m_input{input} {}
- bool for_each_input(const InputHandler& process) const override {
- return process(m_input);
- }
+ bool for_each_input(const InputHandler& process) const override { return process(m_input); }
private:
const std::string m_input;
@@ -141,4 +129,4 @@ inline input::ReaderPtr make_console_reader() {
return std::make_unique<input::ConsoleReader>();
}
-}
+} // namespace math::client::input