diff options
Diffstat (limited to 'src/mmo')
-rw-r--r-- | src/mmo/config_parse.cpp | 1 | ||||
-rw-r--r-- | src/mmo/extract_enums.cpp | 2 | ||||
-rw-r--r-- | src/mmo/extract_enums.hpp | 24 | ||||
-rw-r--r-- | src/mmo/human_time_diff.cpp | 2 | ||||
-rw-r--r-- | src/mmo/human_time_diff.hpp | 2 | ||||
-rw-r--r-- | src/mmo/human_time_diff_test.cpp | 2 | ||||
-rw-r--r-- | src/mmo/ids.cpp | 4 | ||||
-rw-r--r-- | src/mmo/ids.hpp | 6 | ||||
-rw-r--r-- | src/mmo/version.cpp | 2 | ||||
-rw-r--r-- | src/mmo/version.hpp | 2 |
10 files changed, 25 insertions, 22 deletions
diff --git a/src/mmo/config_parse.cpp b/src/mmo/config_parse.cpp index 8362810..b47ee79 100644 --- a/src/mmo/config_parse.cpp +++ b/src/mmo/config_parse.cpp @@ -24,6 +24,7 @@ #include "../strings/zstring.hpp" #include "../io/cxxstdio.hpp" +#include "../io/extract.hpp" #include "../io/line.hpp" #include "version.hpp" diff --git a/src/mmo/extract_enums.cpp b/src/mmo/extract_enums.cpp index ecf6940..efafa39 100644 --- a/src/mmo/extract_enums.cpp +++ b/src/mmo/extract_enums.cpp @@ -23,7 +23,7 @@ namespace tmwa { -bool extract(XString str, DIR *d) +bool impl_extract(XString str, DIR *d) { unsigned di; if (extract(str, &di) && di < 8) diff --git a/src/mmo/extract_enums.hpp b/src/mmo/extract_enums.hpp index 96e5df7..1aab17e 100644 --- a/src/mmo/extract_enums.hpp +++ b/src/mmo/extract_enums.hpp @@ -38,15 +38,15 @@ enum class Opt2 : uint16_t; enum class Opt0 : uint16_t; inline -bool extract(XString str, EPOS *iv) { return extract_as_int(str, iv); } +bool impl_extract(XString str, EPOS *iv) { return extract_as_int(str, iv); } inline -bool extract(XString str, MobMode *iv) { return extract_as_int(str, iv); } +bool impl_extract(XString str, MobMode *iv) { return extract_as_int(str, iv); } inline -bool extract(XString str, Opt1 *iv) { return extract_as_int(str, iv); } +bool impl_extract(XString str, Opt1 *iv) { return extract_as_int(str, iv); } inline -bool extract(XString str, Opt2 *iv) { return extract_as_int(str, iv); } +bool impl_extract(XString str, Opt2 *iv) { return extract_as_int(str, iv); } inline -bool extract(XString str, Opt0 *iv) { return extract_as_int(str, iv); } +bool impl_extract(XString str, Opt0 *iv) { return extract_as_int(str, iv); } } enum class ItemLook : uint16_t; @@ -57,17 +57,17 @@ enum class SkillID : uint16_t; enum class StatusChange : uint16_t; inline -bool extract(XString str, ItemLook *iv) { return extract_as_int(str, iv); } +bool impl_extract(XString str, ItemLook *iv) { return extract_as_int(str, iv); } inline -bool extract(XString str, ItemType *iv) { return extract_as_int(str, iv); } +bool impl_extract(XString str, ItemType *iv) { return extract_as_int(str, iv); } inline -bool extract(XString str, Race *iv) { return extract_as_int(str, iv); } +bool impl_extract(XString str, Race *iv) { return extract_as_int(str, iv); } inline -bool extract(XString str, SEX *iv) { return extract_as_int(str, iv); } +bool impl_extract(XString str, SEX *iv) { return extract_as_int(str, iv); } inline -bool extract(XString str, SkillID *iv) { return extract_as_int(str, iv); } +bool impl_extract(XString str, SkillID *iv) { return extract_as_int(str, iv); } inline -bool extract(XString str, StatusChange *iv) { return extract_as_int(str, iv); } +bool impl_extract(XString str, StatusChange *iv) { return extract_as_int(str, iv); } -bool extract(XString, DIR *); +bool impl_extract(XString, DIR *); } // namespace tmwa diff --git a/src/mmo/human_time_diff.cpp b/src/mmo/human_time_diff.cpp index e434773..aaa7928 100644 --- a/src/mmo/human_time_diff.cpp +++ b/src/mmo/human_time_diff.cpp @@ -25,7 +25,7 @@ namespace tmwa { -bool extract(XString str, HumanTimeDiff *iv) +bool impl_extract(XString str, HumanTimeDiff *iv) { // str is a sequence of [-+]?[0-9]+([ay]|m|[jd]|h|mn|s) // there are NO spaces here diff --git a/src/mmo/human_time_diff.hpp b/src/mmo/human_time_diff.hpp index 40352d0..92b3288 100644 --- a/src/mmo/human_time_diff.hpp +++ b/src/mmo/human_time_diff.hpp @@ -42,5 +42,5 @@ struct HumanTimeDiff return !bool(*this); } }; -bool extract(XString str, HumanTimeDiff *iv); +bool impl_extract(XString str, HumanTimeDiff *iv); } // namespace tmwa diff --git a/src/mmo/human_time_diff_test.cpp b/src/mmo/human_time_diff_test.cpp index c18599d..08a75bf 100644 --- a/src/mmo/human_time_diff_test.cpp +++ b/src/mmo/human_time_diff_test.cpp @@ -20,6 +20,8 @@ #include <gtest/gtest.h> +#include "../io/extract.hpp" + #include "../poison.hpp" diff --git a/src/mmo/ids.cpp b/src/mmo/ids.cpp index 9c013ba..65c470b 100644 --- a/src/mmo/ids.cpp +++ b/src/mmo/ids.cpp @@ -25,7 +25,7 @@ namespace tmwa { -bool extract(XString str, Species *w) +bool impl_extract(XString str, Species *w) { // lots of data files use this if (str == "-1"_s) @@ -35,7 +35,7 @@ bool extract(XString str, Species *w) } return extract(str, &w->_value); } -bool extract(XString str, GmLevel *lvl) +bool impl_extract(XString str, GmLevel *lvl) { return extract(str, &lvl->bits); } diff --git a/src/mmo/ids.hpp b/src/mmo/ids.hpp index 389f9e9..c1482ef 100644 --- a/src/mmo/ids.hpp +++ b/src/mmo/ids.hpp @@ -30,7 +30,7 @@ class Species : public Wrapped<uint16_t> { public: explicit operator bool() cons constexpr Species NEGATIVE_SPECIES = Species(); -bool extract(XString str, Species *w); +bool impl_extract(XString str, Species *w); class AccountId : public Wrapped<uint32_t> { public: constexpr AccountId() : Wrapped<uint32_t>() {} protected: constexpr explicit AccountId(uint32_t a) : Wrapped<uint32_t>(a) {} }; @@ -41,12 +41,12 @@ class ItemNameId : public Wrapped<uint16_t> { public: constexpr ItemNameId() : W class BlockId : public Wrapped<uint32_t> { public: constexpr BlockId() : Wrapped<uint32_t>() {} protected: constexpr explicit BlockId(uint32_t a) : Wrapped<uint32_t>(a) {} }; -bool extract(XString str, GmLevel *lvl); +bool impl_extract(XString str, GmLevel *lvl); class GmLevel { uint32_t bits; - friend bool extract(XString str, GmLevel *lvl); + friend bool impl_extract(XString str, GmLevel *lvl); constexpr explicit GmLevel(uint32_t b) : bits(b) {} constexpr explicit diff --git a/src/mmo/version.cpp b/src/mmo/version.cpp index aec4e73..93ea794 100644 --- a/src/mmo/version.cpp +++ b/src/mmo/version.cpp @@ -66,7 +66,7 @@ Version CURRENT_MAP_SERVER_VERSION = LString CURRENT_VERSION_STRING = VERSION_STRING; -bool extract(XString str, Version *vers) +bool impl_extract(XString str, Version *vers) { *vers = {}; // TODO should I try to extract dev and vend also? diff --git a/src/mmo/version.hpp b/src/mmo/version.hpp index 1eed223..a09953f 100644 --- a/src/mmo/version.hpp +++ b/src/mmo/version.hpp @@ -87,7 +87,7 @@ extern Version CURRENT_MAP_SERVER_VERSION; extern LString CURRENT_VERSION_STRING; -bool extract(XString str, Version *vers); +bool impl_extract(XString str, Version *vers); extern LString VERSION_INFO_HEADER; extern LString VERSION_INFO_COMMIT; |