diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/jsonParse-persistence.cpp (renamed from lib/jsonParse-persistance.cpp) | 28 | ||||
-rw-r--r-- | lib/jsonParse-persistence.h (renamed from lib/jsonParse-persistance.h) | 6 | ||||
-rw-r--r-- | lib/persistence.cpp (renamed from lib/persistance.cpp) | 4 | ||||
-rw-r--r-- | lib/persistence.h (renamed from lib/persistance.h) | 12 |
4 files changed, 25 insertions, 25 deletions
diff --git a/lib/jsonParse-persistance.cpp b/lib/jsonParse-persistence.cpp index 100fa5c..5b3314e 100644 --- a/lib/jsonParse-persistance.cpp +++ b/lib/jsonParse-persistence.cpp @@ -1,8 +1,8 @@ -#include "jsonParse-persistance.h" +#include "jsonParse-persistence.h" -namespace Persistanace { +namespace Persistence { void - JsonParsePersistance::loadState(std::istream & in) + JsonParsePersistence::loadState(std::istream & in) { this->switch_streams(&in, nullptr); yy_push_state(0); @@ -10,58 +10,58 @@ namespace Persistanace { } void - JsonParsePersistance::beginObject() + JsonParsePersistence::beginObject() { current()->beforeValue(stk); current()->beginObject(stk); } void - JsonParsePersistance::beginArray() + JsonParsePersistence::beginArray() { current()->beforeValue(stk); current()->beginArray(stk); } void - JsonParsePersistance::pushBoolean(bool value) + JsonParsePersistence::pushBoolean(bool value) { pushValue(value); } void - JsonParsePersistance::pushNumber(float value) + JsonParsePersistence::pushNumber(float value) { pushValue(value); } void - JsonParsePersistance::pushNull() + JsonParsePersistence::pushNull() { pushValue(nullptr); } void - JsonParsePersistance::pushText(std::string && value) + JsonParsePersistence::pushText(std::string && value) { pushValue(value); } void - JsonParsePersistance::pushKey(std::string && k) + JsonParsePersistence::pushKey(std::string && k) { stk.push(current()->select(k)); } void - JsonParsePersistance::endArray() + JsonParsePersistence::endArray() { stk.pop(); stk.pop(); } void - JsonParsePersistance::endObject() + JsonParsePersistence::endObject() { current()->endObject(stk); current()->endObject(stk); @@ -69,7 +69,7 @@ namespace Persistanace { template<typename T> inline void - JsonParsePersistance::pushValue(T && value) + JsonParsePersistence::pushValue(T && value) { current()->beforeValue(stk); current()->setValue(value); @@ -77,7 +77,7 @@ namespace Persistanace { } inline SelectionPtr & - JsonParsePersistance::current() + JsonParsePersistence::current() { return stk.top(); } diff --git a/lib/jsonParse-persistance.h b/lib/jsonParse-persistence.h index 37483bc..6449f7b 100644 --- a/lib/jsonParse-persistance.h +++ b/lib/jsonParse-persistence.h @@ -2,14 +2,14 @@ #define JSONPARSE_PERSISTANCE #include "jsonParse.h" // IWYU pragma: export -#include "persistance.h" // IWYU pragma: export +#include "persistence.h" // IWYU pragma: export #include <functional> #include <iosfwd> #include <memory> #include <string> -namespace Persistanace { - class JsonParsePersistance : public json::jsonParser { +namespace Persistence { + class JsonParsePersistence : public json::jsonParser { public: template<typename T> inline T diff --git a/lib/persistance.cpp b/lib/persistence.cpp index 204e8f0..5744cd7 100644 --- a/lib/persistance.cpp +++ b/lib/persistence.cpp @@ -1,7 +1,7 @@ -#include "persistance.h" +#include "persistence.h" #include <map> -namespace Persistanace { +namespace Persistence { using Factories = std::pair<std::function<std::unique_ptr<Persistable>()>, std::function<std::shared_ptr<Persistable>()>>; using NamedTypeFactories = std::map<std::string_view, Factories>; diff --git a/lib/persistance.h b/lib/persistence.h index c64d4ec..ed21ec8 100644 --- a/lib/persistance.h +++ b/lib/persistence.h @@ -18,7 +18,7 @@ namespace glm { template<glm::length_t L, typename T, glm::qualifier Q> struct vec; } -namespace Persistanace { +namespace Persistence { struct Selection; using SelectionPtr = std::unique_ptr<Selection>; using Stack = std::stack<SelectionPtr>; @@ -75,7 +75,7 @@ namespace Persistanace { } }; - struct PersistanceStore { + struct PersistenceStore { template<typename T> inline bool persistType() const; template<typename T> @@ -144,7 +144,7 @@ namespace Persistanace { virtual ~Persistable() = default; DEFAULT_MOVE_COPY(Persistable); - virtual bool persist(PersistanceStore & store) = 0; + virtual bool persist(PersistenceStore & store) = 0; template<typename T> constexpr static auto @@ -171,7 +171,7 @@ namespace Persistanace { template<typename T> inline bool - PersistanceStore::persistType() const + PersistenceStore::persistType() const { if constexpr (!std::is_abstract_v<T>) { [[maybe_unused]] constexpr auto f = &Persistable::addFactory<T>; @@ -216,7 +216,7 @@ namespace Persistanace { this->v = std::make_unique<T>(); } } - PersistanceStore ps {mbr}; + PersistenceStore ps {mbr}; if (this->v->persist(ps)) { throw std::runtime_error("cannot find member: " + mbr); } @@ -314,7 +314,7 @@ namespace Persistanace { this->v = std::make_shared<T>(); } } - PersistanceStore ps {mbr}; + PersistenceStore ps {mbr}; if (this->v->persist(ps)) { throw std::runtime_error("cannot find member: " + mbr); } |