1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-17 01:10:10 +00:00
OpenMW/components/esm/formidrefid.cpp
elsid 069d4255b9
Make ESM::RefId to be fixed size cheap to copy
Use std::variant. Store refId strings in unordered_set and use pointer to an
item there. Inserts to unordered_set do not invalidate pointers to values so the
pointer is always valid. Elements are not removed. Assume there is finite number
of string refIds.
2023-03-19 17:20:43 +01:00

25 lines
477 B
C++

#include "formidrefid.hpp"
#include <ostream>
#include <sstream>
namespace ESM
{
std::string FormIdRefId::toString() const
{
return std::to_string(mValue);
}
std::string FormIdRefId::toDebugString() const
{
std::ostringstream stream;
stream << *this;
return stream.str();
}
std::ostream& operator<<(std::ostream& stream, FormIdRefId value)
{
return stream << "FormId{" << value.mValue << '}';
}
}