Reorganized project again.

This commit is contained in:
2023-12-17 15:56:13 -08:00
parent 54b9e82789
commit 3acb78f247
250 changed files with 1586 additions and 1586 deletions

62
src/json/JsonStr.cpp Normal file
View File

@@ -0,0 +1,62 @@
#include "json/JsonStr.h"
namespace ehs
{
JsonStr::JsonStr()
: JsonBase(JsonType::STR)
{
}
JsonStr::JsonStr(Str_8 value)
: JsonBase(JsonType::STR), value(std::move(value))
{
}
JsonStr::JsonStr(const Char_8* value, const UInt_64 size)
: JsonBase(JsonType::STR), value(value, size)
{
}
JsonStr::JsonStr(JsonStr&& js) noexcept
: JsonBase(js), value(std::move(js.value))
{
}
JsonStr& JsonStr::operator=(JsonStr&& js) noexcept
{
if (this == &js)
return *this;
JsonBase::operator=(js);
value = std::move(js.value);
return *this;
}
JsonStr::operator Str_8() const
{
return value;
}
JsonStr::operator Str_8&()
{
return value;
}
Str_8 JsonStr::ToStr(const UInt_64 level, const bool compact) const
{
Str_8 result;
if (!compact)
{
for (UInt_64 l = 0; l < level; ++l)
result += "\t";
}
result += "\"" + value + "\"";
return result;
}
}