Files
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

64 lines
1.1 KiB
C++

#pragma once
class CDataContainer
{
public:
enum DataType
{
eInt = 0, // 整型
eDouble = 1, // 浮点型
ePoint = 2, // 点
eVector = 3, // 向量
eTchar = 4, // 字符串
eId = 5, // AcDbObjectId
};
typedef struct
{
int nVt; // 所保存数据的类型
int npszLen;
union
{
double dVal[3];
short nVal;
TCHAR *pszVal;
LONG_PTR nId;
};
}TParam;
public:
bool GetData(LPCTSTR pszKey, double &dVal);
bool SetData(LPCTSTR pszKey, double dVal);
bool GetData(LPCTSTR pszKey, int &nVal);
bool SetData(LPCTSTR pszKey, int nVal);
bool GetData(LPCTSTR pszKey, CString &strVal);
bool SetData(LPCTSTR pszKey, const CString &strVal);
bool GetData(LPCTSTR pszKey, AcGePoint3d &pt);
bool SetData(LPCTSTR pszKey, const AcGePoint3d &pt);
bool GetData(LPCTSTR pszKey, AcGeVector3d &vt);
bool SetData(LPCTSTR pszKey, const AcGeVector3d &vt);
bool GetData(LPCTSTR pszKey, AcDbObjectId &id);
bool SetData(LPCTSTR pszKey, const AcDbObjectId &id);
typedef std::map<CString,TParam>::iterator It;
private:
std::map<CString,TParam> m_mapDParam;
};