Files
envi-code/SourceCode/Code2026/tg_shs/inc/geo/TPushAcadVar.h
T
2026-09-28 15:28:50 +08:00

81 lines
1.4 KiB
C++

//-----------------------------------------------------------------------------+
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
// = FileName : TPushAcadVar.h
// = Version : ver2.0
// = Author : xlc
// = CreateDate : 2002-09-09
// = Description: 类的声明
// = Maintainers:
//
//-----------------------------------------------------------------------------+
#ifndef _TPUSHACADVAR_H_
#define _TPUSHACADVAR_H_
#ifndef _TACSTRING_H_
#include "TACString.h"
#endif
#ifndef _TWCSTRING_H_
#include "TWCString.h"
#endif
#ifndef _TCHPRIVATEGLOBALFUNC_H_
#include "TchPrivateGlobalFunc.h"
#endif
#ifndef _TPUSHVARSTR_H_
#include "TPushVarStr.h"
#endif
template <class K,bool bLayer = false>
class TPushAcadVar
{
public:
TPushAcadVar(const TCHAR *pszVar, K kVal)
: var(pszVar),value(80)
{
TGGetVar(pszVar, &value);
if (bLayer)
{
if (pszVar)
{
if (_tcsicmp(pszVar, _T("clayer")) == 0)
{
//modify by xlc on 111205 确保当前层存在,不是当前层的系统变量
//AssureLayer(pszVar, 0); // 确保存在
AssureLayer((const TCHAR*)kVal, 0); // 确保存在
}
TGSetVar(pszVar, kVal);
}
}
else
{
TGSetVar(pszVar, kVal);
}
}
TPushAcadVar(const TCHAR *pszVar)
: var(pszVar)
{
if (!bLayer)
{
TGGetVar(pszVar, &value);
}
}
virtual ~TPushAcadVar()
{
TGSetVar((const TCHAR *)var, value);
}
public:
TCString var;
K value;
};
#endif