aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/client/input.hpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-01-13 08:39:02 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-01-13 08:42:08 +0300
commit6913c6d965d64481ed09fc06a43154f35e8bd914 (patch)
treefa8d3f360a651a31fba4b91a09a5bba505a904c4 /client/input.hpp
parentTravis: only run clang-format on master (diff)
downloadmath-server-6913c6d965d64481ed09fc06a43154f35e8bd914.tar.gz
math-server-6913c6d965d64481ed09fc06a43154f35e8bd914.zip
clang-format all the code
Diffstat (limited to '')
-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