bool DataObjectListHelper::IsObjectListType( const CString& name ) { ArxDictTool* pDictTool = ArxDictTool::GetDictTool( OBJECT_LIST_DICT ); bool ret = pDictTool->findKey( name ); delete pDictTool; return ret; }
static bool FindKey_Helper( const CString& dictName, const CString& type ) { ArxDictTool* pDictTool = ArxDictTool::GetDictTool( dictName ); bool ret = pDictTool->findKey( type ); delete pDictTool; return ret; }
bool ArxDictHelper::GetAllEntries( const CString& dictName, const CString& key, AcStringArray& entries ) { if( key.GetLength() == 0 ) return false; entries.removeAll(); ArxDictTool* pDictTool = ArxDictTool::GetDictTool( dictName ); bool ret = pDictTool->findKey( key ); if( ret ) { pDictTool->getAllEntries( key, entries ); } delete pDictTool; return ret; }
bool StringListHelper::AddStringList( const CString& name, const AcStringArray& strList ) { if( ( name.GetLength() == 0 ) || strList.isEmpty() ) return false; ArxDictTool* pDictTool = ArxDictTool::GetDictTool( STRING_LIST_DICT ); bool ret = pDictTool->findKey( name ); if( !ret ) // 如果变量name已存在,则不进行修改 { int len = strList.length(); for( int i = 0; i < len; i++ ) { pDictTool->addEntry( name, strList[i].kACharPtr() ); } } delete pDictTool; return !ret; }
bool IntStrListHelper::AddIntStrList( const CString& name, const AcDbIntArray& intList, const AcStringArray& strList ) { if( ( name.GetLength() == 0 ) || strList.isEmpty() || intList.isEmpty() ) return false; if( intList.length() != strList.length() ) return false; ArxDictTool* pDictTool = ArxDictTool::GetDictTool( INT_LIST_DICT ); bool ret = pDictTool->findKey( name ); if( !ret ) { int len = intList.length(); for( int i = 0; i < len; i++ ) { CString intValue; intValue.Format( _T( "%d" ), intList[i] ); pDictTool->addEntry( name, intValue ); // 偶数位置的元素为整数 pDictTool->addEntry( name, strList[i].kACharPtr() ); // 奇数位置的元素为字符串 } } delete pDictTool; return !ret; }