Files
envi-code/SourceCode/Code2026/tg_shs/shs_subgeLib/TWCharItem.cpp
T

59 lines
1.2 KiB
C++
Raw Normal View History

2026-10-04 00:04:20 +08:00
//-----------------------------------------------------------------------------+
2026-09-28 15:28:50 +08:00
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
2026-10-04 00:04:20 +08:00
// = FileName : TWCharItem 类
2026-09-28 15:28:50 +08:00
// = Version : ver2.0
// = Author : wlw
// = CreateDate : 2002-09-09
2026-10-04 00:04:20 +08:00
// = Description: TWCharItem 定义
2026-09-28 15:28:50 +08:00
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#include "StdAfx.h"
#include "TWCharItem.h"
TWCharItem::~TWCharItem()
{
}
int TWCharItem::GetType()const
{
return TYPE_WCharItem;
}
void TWCharItem::operator <<(CArchive &ar)
{
TWDictItem::operator << (ar);
ar >> m_data;
}
void TWCharItem::operator >> (CArchive &ar)
{
TWDictItem::operator >> (ar);
ar << m_data;
}
void TWCharItem::CopyData(const TWDictItem &src)
{
if (GetType() != src.GetType())
{
return;
}
const TWCharItem& si = (const TWCharItem&)src;
m_data = si.m_data;
}
void TWCharItem::saveToJson(WValue & v)
{
TWDictItem::saveToJson(v);
v.AddMember(StringRef(_T("data")), WValue((int)m_data), getJsonAllocator());
}
void TWCharItem::loadByJson(const WValue &v)
{
TWDictItem::loadByJson(v);
MCIt it = v.FindMember(_T("data"));
if (it != v.MemberEnd())
m_data = (char)it->value.GetInt();
}