diff --git a/apps/opencs/model/world/collectionbase.hpp b/apps/opencs/model/world/collectionbase.hpp index 7d829e8342..de3623fac0 100644 --- a/apps/opencs/model/world/collectionbase.hpp +++ b/apps/opencs/model/world/collectionbase.hpp @@ -13,7 +13,7 @@ class QVariant; namespace ESM { - struct RefId; + class RefId; } namespace CSMWorld diff --git a/apps/openmw/mwbase/dialoguemanager.hpp b/apps/openmw/mwbase/dialoguemanager.hpp index d673ad7fb0..6792cae078 100644 --- a/apps/openmw/mwbase/dialoguemanager.hpp +++ b/apps/openmw/mwbase/dialoguemanager.hpp @@ -17,7 +17,7 @@ namespace ESM { class ESMReader; class ESMWriter; - struct RefId; + class RefId; } namespace MWWorld diff --git a/apps/openmw/mwbase/mechanicsmanager.hpp b/apps/openmw/mwbase/mechanicsmanager.hpp index cabd4d2a86..8427711689 100644 --- a/apps/openmw/mwbase/mechanicsmanager.hpp +++ b/apps/openmw/mwbase/mechanicsmanager.hpp @@ -21,7 +21,7 @@ namespace osg namespace ESM { struct Class; - struct RefId; + class RefId; class ESMReader; class ESMWriter; } diff --git a/apps/openmw/mwbase/scriptmanager.hpp b/apps/openmw/mwbase/scriptmanager.hpp index dfc1a5ff5e..ceb651e691 100644 --- a/apps/openmw/mwbase/scriptmanager.hpp +++ b/apps/openmw/mwbase/scriptmanager.hpp @@ -10,7 +10,7 @@ namespace Interpreter namespace ESM { - struct RefId; + class RefId; } namespace Compiler diff --git a/apps/openmw/mwbase/soundmanager.hpp b/apps/openmw/mwbase/soundmanager.hpp index c4b907032f..5939318856 100644 --- a/apps/openmw/mwbase/soundmanager.hpp +++ b/apps/openmw/mwbase/soundmanager.hpp @@ -16,7 +16,7 @@ namespace MWWorld namespace ESM { - struct RefId; + class RefId; } namespace MWSound diff --git a/apps/openmw/mwbase/windowmanager.hpp b/apps/openmw/mwbase/windowmanager.hpp index a05924d554..0f61939028 100644 --- a/apps/openmw/mwbase/windowmanager.hpp +++ b/apps/openmw/mwbase/windowmanager.hpp @@ -16,7 +16,7 @@ namespace ESM { - struct RefId; + class RefId; } namespace Loading diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index 7d050ee54a..c239d5b5e6 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -57,7 +57,7 @@ namespace ESM struct CreatureLevList; struct ItemLevList; struct TimeStamp; - struct RefId; + class RefId; } namespace MWPhysics diff --git a/apps/openmw/mwclass/lockpick.hpp b/apps/openmw/mwclass/lockpick.hpp index a258c80d7a..c95dc6ecad 100644 --- a/apps/openmw/mwclass/lockpick.hpp +++ b/apps/openmw/mwclass/lockpick.hpp @@ -5,7 +5,7 @@ namespace ESM { - struct RefId; + class RefId; } namespace MWClass diff --git a/apps/openmw/mwdialogue/filter.hpp b/apps/openmw/mwdialogue/filter.hpp index b49a92e1d5..74afb41425 100644 --- a/apps/openmw/mwdialogue/filter.hpp +++ b/apps/openmw/mwdialogue/filter.hpp @@ -9,7 +9,7 @@ namespace ESM { struct DialInfo; struct Dialogue; - struct RefId; + class RefId; } namespace MWDialogue diff --git a/apps/openmw/mwmechanics/summoning.hpp b/apps/openmw/mwmechanics/summoning.hpp index f042d5a20a..c322589876 100644 --- a/apps/openmw/mwmechanics/summoning.hpp +++ b/apps/openmw/mwmechanics/summoning.hpp @@ -5,7 +5,7 @@ #include namespace ESM { - struct RefId; + class RefId; } namespace MWWorld { diff --git a/apps/openmw/mwscript/compilercontext.hpp b/apps/openmw/mwscript/compilercontext.hpp index 1c11ed8877..eaf794853b 100644 --- a/apps/openmw/mwscript/compilercontext.hpp +++ b/apps/openmw/mwscript/compilercontext.hpp @@ -5,7 +5,7 @@ namespace ESM { - struct RefId; + class RefId; } namespace MWScript diff --git a/apps/openmw/mwscript/locals.hpp b/apps/openmw/mwscript/locals.hpp index 94047f9150..1cc8fecb9b 100644 --- a/apps/openmw/mwscript/locals.hpp +++ b/apps/openmw/mwscript/locals.hpp @@ -12,7 +12,7 @@ namespace ESM { class Script; struct Locals; - struct RefId; + class RefId; } namespace MWScript diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 2e0f8f1b22..bb5a5d89b6 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -45,7 +45,7 @@ namespace SceneUtil namespace ESM { struct Position; - struct RefId; + class RefId; } namespace Files diff --git a/components/compiler/context.hpp b/components/compiler/context.hpp index ab600b10dd..f25d0620e3 100644 --- a/components/compiler/context.hpp +++ b/components/compiler/context.hpp @@ -4,7 +4,7 @@ #include namespace ESM { - struct RefId; + class RefId; } namespace Compiler diff --git a/components/detournavigator/navigator.hpp b/components/detournavigator/navigator.hpp index dbe6e26dad..3e522b72b6 100644 --- a/components/detournavigator/navigator.hpp +++ b/components/detournavigator/navigator.hpp @@ -16,7 +16,7 @@ namespace ESM { struct Cell; struct Pathgrid; - struct RefId; + class RefId; } namespace Loading diff --git a/components/esm/esmbridge.hpp b/components/esm/esmbridge.hpp index 5576fccc03..8810e30594 100644 --- a/components/esm/esmbridge.hpp +++ b/components/esm/esmbridge.hpp @@ -16,7 +16,7 @@ namespace ESM { struct Cell; struct CellId; - struct RefId; + class RefId; class CellVariant { diff --git a/components/esm/refid.hpp b/components/esm/refid.hpp index c93ff4df02..16f42b6915 100644 --- a/components/esm/refid.hpp +++ b/components/esm/refid.hpp @@ -13,8 +13,9 @@ namespace ESM // RefId is used to represent an Id that identifies an ESM record. These Ids can then be used in // ESM::Stores to find the actual record. These Ids can be serialized/de-serialized, stored on disk and remain // valid. They are used by ESM files, by records to reference other ESM records. - struct RefId + class RefId { + public: const static RefId sEmpty; bool empty() const { return mId.empty(); } @@ -32,17 +33,16 @@ namespace ESM static RefId formIdRefId(const ESM4::FormId id); const std::string& getRefIdString() const { return mId; } - private: - std::string mId; - - bool operator==(std::string_view rhs) const; - - public: template bool operator==(const char (&rhs)[size]) const { return *this == std::string_view(rhs); } + + private: + std::string mId; + + bool operator==(std::string_view rhs) const; }; } diff --git a/components/esm3/spellstate.hpp b/components/esm3/spellstate.hpp index 39462f039f..1b273b92fa 100644 --- a/components/esm3/spellstate.hpp +++ b/components/esm3/spellstate.hpp @@ -13,7 +13,7 @@ namespace ESM { class ESMReader; class ESMWriter; - struct RefId; + class RefId; // NOTE: spell ids must be lower case struct SpellState diff --git a/components/esmloader/esmdata.hpp b/components/esmloader/esmdata.hpp index 556291d3a8..a123210c11 100644 --- a/components/esmloader/esmdata.hpp +++ b/components/esmloader/esmdata.hpp @@ -16,7 +16,7 @@ namespace ESM struct Land; struct Static; class Variant; - struct RefId; + class RefId; } namespace EsmLoader diff --git a/components/misc/resourcehelpers.hpp b/components/misc/resourcehelpers.hpp index 079171c505..64782a8ccb 100644 --- a/components/misc/resourcehelpers.hpp +++ b/components/misc/resourcehelpers.hpp @@ -11,7 +11,7 @@ namespace VFS namespace ESM { - struct RefId; + class RefId; } namespace Misc