#include "xlocalizeentry.h"

XLocalizeEntry::XLocalizeEntry()
    : XAsset()
    , mValue(new XString())
    , mName(new XString())
{
    SetType(ASSET_TYPE_LOCALIZE_ENTRY);
    SetName("Localize Entry");
}

XLocalizeEntry::~XLocalizeEntry()
{
    delete mValue;
    delete mName;
}

XString* XLocalizeEntry::GetValue() const
{
    return mValue;
}

XString* XLocalizeEntry::GetName() const
{
    return mName;
}

void XLocalizeEntry::Clear()
{
    mValue->Clear();
    mName->Clear();
}

void XLocalizeEntry::ParseData(XDataStream *aStream)
{
    if (GetPtr() == -1)
    {
        mValue->ParsePtr(aStream, false);
        mName->ParsePtr(aStream, false);

        mValue->ParseData(aStream);
        mName->ParseData(aStream);
    }
}

void XLocalizeEntry::SetValue(XString* aValue)
{
    mValue = aValue;
}

void XLocalizeEntry::SetValue(QString aValue)
{
    mValue->SetString(aValue);
}

void XLocalizeEntry::SetName(XString* aName)
{
    mName = aName;
}

void XLocalizeEntry::SetName(QString aName)
{
    mName->SetString(aName);
}
