mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-04 20:57:49 +00:00
50 lines
912 B
C++
50 lines
912 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
namespace RBX {
|
|
|
|
// use this for properties that contain binary data so that they're serialized to XML without roundtrip issues
|
|
class BinaryString
|
|
{
|
|
public:
|
|
BinaryString()
|
|
{
|
|
}
|
|
|
|
explicit BinaryString(const std::string& value)
|
|
: internalValue(value)
|
|
{
|
|
}
|
|
|
|
const std::string& value() const
|
|
{
|
|
return internalValue;
|
|
}
|
|
|
|
void set(const char* buffer, unsigned int size)
|
|
{
|
|
internalValue.assign(buffer, size);
|
|
}
|
|
|
|
bool operator==(const BinaryString& other) const
|
|
{
|
|
return internalValue == other.internalValue;
|
|
}
|
|
|
|
bool operator!=(const BinaryString& other) const
|
|
{
|
|
return internalValue != other.internalValue;
|
|
}
|
|
|
|
bool operator<(const BinaryString& other) const
|
|
{
|
|
return internalValue < other.internalValue;
|
|
}
|
|
|
|
private:
|
|
std::string internalValue;
|
|
};
|
|
|
|
}
|