From bbc325c3a996bdbec6c310551ed47d6f3b29167b Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Sun, 25 Sep 2022 13:45:15 +0300 Subject: [PATCH] chore: move data.hh to utils --- include/{ => utils}/data.hh | 20 ++++++++++---------- src/main/opions.hh | 2 +- src/utils/data.cc | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) rename include/{ => utils}/data.hh (82%) diff --git a/include/data.hh b/include/utils/data.hh similarity index 82% rename from include/data.hh rename to include/utils/data.hh index 0db5919..2b4201b 100644 --- a/include/data.hh +++ b/include/utils/data.hh @@ -45,22 +45,22 @@ namespace ppc::data { bool string(string_t &out) const; bool boolean(bool_t &out) const; - array_t const &array() const; - map_t const &map() const; + const array_t &array() const; + const map_t &map() const; number_t number() const; - string_t const &string() const; + const string_t &string() const; bool_t boolean() const; - // value_t &operator=(value_t const &other); + // value_t &operator=(const value_t &other); ~value_t(); value_t(); - value_t(array_t const &val); - value_t(map_t const &val); + value_t(const array_t &val); + value_t(const map_t &val); value_t(number_t val); - value_t(string_t const &val); + value_t(const string_t &val); value_t(bool_t val); - value_t(value_t const &other); + value_t(const value_t &other); }; @@ -91,8 +91,8 @@ namespace ppc::data { auto begin() { return values.begin(); } auto end() { return values.end(); } - void push(value_t const &val) { values.push_back(val); } - void insert(value_t const &val, std::size_t i = 0) { values.insert(begin() + i, val); } + void push(const value_t &val) { values.push_back(val); } + void insert(const value_t &val, std::size_t i = 0) { values.insert(begin() + i, val); } void pop() { values.pop_back(); } void remove(std::size_t i = 0) { values.erase(begin() + i); } diff --git a/src/main/opions.hh b/src/main/opions.hh index 3075712..f91f100 100644 --- a/src/main/opions.hh +++ b/src/main/opions.hh @@ -2,7 +2,7 @@ #include #include "utils/message.hh" -#include "data.hh" +#include "utils/data.hh" namespace ppc::options { enum flag_match_type_t { diff --git a/src/utils/data.cc b/src/utils/data.cc index f54daf9..e2801f4 100644 --- a/src/utils/data.cc +++ b/src/utils/data.cc @@ -1,4 +1,4 @@ -#include "data.hh" +#include "utils/data.hh" bool ppc::data::value_t::is_null() const { return type == type_t::Null;