1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-29 03:19:44 +00:00
OpenMW/components/esm/formidrefid.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
902 B
C++
Raw Normal View History

#include "formidrefid.hpp"
2023-04-07 00:14:32 +00:00
#include <cassert>
#include <ostream>
2023-04-07 00:14:32 +00:00
#include "serializerefid.hpp"
namespace ESM
{
std::string FormIdRefId::toString() const
{
std::string result;
2023-04-07 00:14:32 +00:00
assert((mValue.mIndex & 0xff000000) == 0);
size_t v = (static_cast<size_t>(mValue.mContentFile) << 24) | mValue.mIndex;
result.resize(getHexIntegralSize(v) + 2, '\0');
serializeHexIntegral(v, 0, result);
return result;
}
std::string FormIdRefId::toDebugString() const
{
std::string result;
2023-04-07 00:14:32 +00:00
assert((mValue.mIndex & 0xff000000) == 0);
size_t v = (static_cast<size_t>(mValue.mContentFile) << 24) | mValue.mIndex;
serializeRefIdValue(v, formIdRefIdPrefix, result);
return result;
}
std::ostream& operator<<(std::ostream& stream, FormIdRefId value)
{
return stream << value.toDebugString();
}
}