mirror of
https://github.com/Xahau/xahaud.git
synced 2026-06-04 01:06:37 +00:00
merged to 1.9.0-b1
re-added the copy assignment constructor for STArray
This commit is contained in:
@@ -40,10 +40,7 @@ STObject::STObject(SOTemplate const& type, SField const& name) : STBase(name)
|
||||
set(type);
|
||||
}
|
||||
|
||||
STObject::STObject(
|
||||
SOTemplate const& type,
|
||||
SerialIter& sit,
|
||||
SField const& name) noexcept(false)
|
||||
STObject::STObject(SOTemplate const& type, SerialIter& sit, SField const& name)
|
||||
: STBase(name)
|
||||
{
|
||||
v_.reserve(type.size());
|
||||
@@ -60,6 +57,36 @@ STObject::STObject(SerialIter& sit, SField const& name, int depth) noexcept(
|
||||
set(sit, depth);
|
||||
}
|
||||
|
||||
STBase*
|
||||
STObject::copy(std::size_t n, void* buf) const
|
||||
{
|
||||
return emplace(n, buf, *this);
|
||||
}
|
||||
|
||||
STBase*
|
||||
STObject::move(std::size_t n, void* buf)
|
||||
{
|
||||
return emplace(n, buf, std::move(*this));
|
||||
}
|
||||
|
||||
SerializedTypeID
|
||||
STObject::getSType() const
|
||||
{
|
||||
return STI_OBJECT;
|
||||
}
|
||||
|
||||
bool
|
||||
STObject::isDefault() const
|
||||
{
|
||||
return v_.empty();
|
||||
}
|
||||
|
||||
void
|
||||
STObject::add(Serializer& s) const
|
||||
{
|
||||
add(s, withAllFields); // just inner elements
|
||||
}
|
||||
|
||||
STObject&
|
||||
STObject::operator=(STObject&& other)
|
||||
{
|
||||
@@ -86,7 +113,7 @@ STObject::set(const SOTemplate& type)
|
||||
}
|
||||
|
||||
void
|
||||
STObject::applyTemplate(const SOTemplate& type) noexcept(false)
|
||||
STObject::applyTemplate(const SOTemplate& type)
|
||||
{
|
||||
auto throwFieldErr = [](std::string const& field, char const* description) {
|
||||
std::stringstream ss;
|
||||
@@ -140,7 +167,7 @@ STObject::applyTemplate(const SOTemplate& type) noexcept(false)
|
||||
}
|
||||
|
||||
void
|
||||
STObject::applyTemplateFromSField(SField const& sField) noexcept(false)
|
||||
STObject::applyTemplateFromSField(SField const& sField)
|
||||
{
|
||||
SOTemplate const* elements =
|
||||
InnerObjectFormats::getInstance().findSOTemplateBySField(sField);
|
||||
@@ -150,7 +177,7 @@ STObject::applyTemplateFromSField(SField const& sField) noexcept(false)
|
||||
|
||||
// return true = terminated with end-of-object
|
||||
bool
|
||||
STObject::set(SerialIter& sit, int depth) noexcept(false)
|
||||
STObject::set(SerialIter& sit, int depth)
|
||||
{
|
||||
bool reachedEndOfObject = false;
|
||||
|
||||
@@ -232,9 +259,9 @@ STObject::getFullText() const
|
||||
std::string ret;
|
||||
bool first = true;
|
||||
|
||||
if (fName->hasName())
|
||||
if (getFName().hasName())
|
||||
{
|
||||
ret = fName->getName();
|
||||
ret = getFName().getName();
|
||||
ret += " = {";
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user