mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-04 20:57:49 +00:00
fahhh
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
#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;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user