当前位置: 首页>>代码示例>>C++>>正文


C++ CAtlMap::SetAt方法代码示例

本文整理汇总了C++中CAtlMap::SetAt方法的典型用法代码示例。如果您正苦于以下问题:C++ CAtlMap::SetAt方法的具体用法?C++ CAtlMap::SetAt怎么用?C++ CAtlMap::SetAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAtlMap的用法示例。


在下文中一共展示了CAtlMap::SetAt方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: write

	void IFileContainer::write(Rels::File& rels, const CPath& curdir, const CPath& directory, ContentTypes::File& content) const
	{
		CAtlMap<CString, size_t> namepair;

		POSITION pos = m_container.GetStartPosition();
		while (NULL != pos)
		{
			const CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.GetNext(pos);
			
			smart_ptr<OOX::File> pFile		= pPair->m_value;
			smart_ptr<OOX::External> pExt	= pFile.smart_dynamic_cast<OOX::External>();

			if (!pExt.IsInit())
			{
				OOX::CPath defdir	= pFile->DefaultDirectory();
				OOX::CPath name		= pFile->DefaultFileName();

				CAtlMap<CString, size_t>::CPair* pNamePair = namepair.Lookup(name.m_strFilename);
				if (NULL == pNamePair)
					namepair.SetAt(name.m_strFilename, 1);
				else
					name = name + pNamePair->m_key;

				OOX::CSystemUtility::CreateDirectories(curdir / defdir);
				pFile->write(curdir / defdir / name, directory / defdir, content);
				rels.registration(pPair->m_key, pFile->type(), defdir / name);
			}
			else
			{
				
				
				rels.registration(pPair->m_key, pExt);
			}
		}
	}
开发者ID:Alsan,项目名称:ONLYOFFICE-OnlineEditors,代码行数:35,代码来源:IFileContainer.cpp

示例2: Commit

	void IFileContainer::Commit(const CPath& path)
	{
		CAtlMap<CString, size_t> namepair;

		POSITION pos = m_container.GetStartPosition();
		while (NULL != pos)
		{
			CAtlMap<CString, smart_ptr<OOX::File>>::CPair* pPair = m_container.GetNext(pos);
			
			smart_ptr<OOX::File> pFile		= pPair->m_value;
			smart_ptr<OOX::External> pExt	= pFile.smart_dynamic_cast<OOX::External>();

			if (!pExt.IsInit())
			{
				OOX::CPath defdir	= pFile->DefaultDirectory();
				OOX::CPath name		= pFile->DefaultFileName();

				CAtlMap<CString, size_t>::CPair* pNamePair = namepair.Lookup(name.m_strFilename);
				if (NULL == pNamePair)
					namepair.SetAt(name.m_strFilename, 1);
				else
					name = name + pNamePair->m_key;

				OOX::CSystemUtility::CreateDirectories(path / defdir);
				
				smart_ptr<OOX::IFileBuilder> fileBuilder = pPair->m_value.smart_dynamic_cast<OOX::IFileBuilder>();
				if (fileBuilder.is_init())
					fileBuilder->Commit(path / defdir / name);
			}
		}
	}
开发者ID:Alsan,项目名称:ONLYOFFICE-OnlineEditors,代码行数:31,代码来源:IFileContainer.cpp

示例3: FillSpecFunctionArray

void CFunctionManager::FillSpecFunctionArray()
{
	m_SelectedFunctions.RemoveAll();
	for (size_t i = 0;i < m_pClass->Parents.GetCount(); i++)
	{
		SpecFunctionParent SpecParent;
		if (m_sSpecFunctions.Lookup(m_pClass->Parents[i]->Name, SpecParent))
		{
			CAtlMap<int, bool> ConditionResult;
			bool bDefault = true;
			for (size_t i = 0; i < SpecParent.Conditions.GetCount(); i++)
			{
				bool bRes = CheckSpecialCondition(SpecParent.Conditions[i]);
				bDefault &= !bRes;
				ConditionResult.SetAt(SpecParent.Conditions[i], bRes);
			}
			if (SpecParent.Conditions.GetCount())
			{
				ConditionResult.SetAt(0, bDefault);
			}
			CSmartAtlArray<SpecFunctionStruct>& SpecFunctions = SpecParent.SpecFunctions;
			for (size_t i = 0; i < SpecFunctions.GetCount(); i++)
			{
				if (SpecFunctions[i].Condition == -1)
				{
					m_SelectedFunctions.Add(SpecFunctions[i]);
				}
				else
				{
					bool bRes;
					if (ConditionResult.Lookup(SpecFunctions[i].Condition, bRes))
					{
						if (bRes)
						{
							m_SelectedFunctions.Add(SpecFunctions[i]);
						}
					}
				}
			}
		}
	}
}
开发者ID:axxapp,项目名称:winxgui,代码行数:42,代码来源:FunctionManager.cpp

示例4: DoEnumCurrnetSubKey

BOOL CRegOpt::DoEnumCurrnetSubKey(HKEY hRootKey,LPCTSTR lpcKey,CAtlMap<CString,char>& vec_Key)
{
	HKEY hKey;
	LONG lResult;
	
	//打开键
	lResult = RegOpenKeyEx(hRootKey,
		lpcKey,
		NULL,
		KEY_READ,
		&hKey
		);

	if(lResult != ERROR_SUCCESS)
	{	
		m_iErrCode = lResult;
		return FALSE;
	}

	//枚举键名
	BOOL  bRet = TRUE;
	DWORD dwIndex=0;
	do 
	{	
		TCHAR szKey[MAX_PATH]={0};
		DWORD dwKey = sizeof(szKey);
		lResult =RegEnumKey(hKey,dwIndex,szKey,dwKey);

		if (lResult != ERROR_SUCCESS)
		{
			if (lResult == ERROR_NO_MORE_ITEMS)
			{	
				bRet = TRUE;
				break;
			}
			else
			{	
				bRet = FALSE;
				m_iErrCode = lResult;
				break;
			}
		}
		
		
		vec_Key.SetAt(szKey,'1');
		dwIndex++;

	} while (1);

	RegCloseKey(hKey);

	return bRet;
}
开发者ID:dreamsxin,项目名称:PcManager,代码行数:53,代码来源:regopt.cpp

示例5: TryInsertPeerIDMessageID

bool CPeerInfo::TryInsertPeerIDMessageID(unsigned int PeerID, unsigned MessageID)
{
	CAtlMap<unsigned int, void*> *MessageIDMap;
	if(PeerIDMessageIDMap.Lookup(PeerID, MessageIDMap) == false)
	{
		MessageIDMap = new CAtlMap<unsigned int, void*>();
		PeerIDMessageIDMap.SetAt(PeerID, MessageIDMap);
	}

	void *Temp;
	if(MessageIDMap->Lookup(MessageID, Temp) == true) return false;
	else
	{
		MessageIDMap->SetAt(MessageID, NULL);
		return true;
	}
}
开发者ID:wonsch,项目名称:ds,代码行数:17,代码来源:PeerInfo.cpp

示例6: GetDTMgrForPhone

IDTManager* CMainDlg::GetDTMgrForPhone()
{
	if(m_pPhoneDTMgr == NULL && CreateObject != NULL)
	{
		CreateObject(__uuidof(IDTManager), (void**)&m_pPhoneDTMgr);

		if(m_pPhoneDTMgr != NULL)
		{
			CAtlMap<DtStateChangeNotifyCallBack,void*> *pCallback = new CAtlMap<DtStateChangeNotifyCallBack,void*>;
			pCallback->SetAt(PhoneSoftDownCallback, this);

			m_pPhoneDTMgr->Init(pCallback);
		}
	}

	return m_pPhoneDTMgr;
}
开发者ID:6520874,项目名称:pcmanager,代码行数:17,代码来源:MainDlg.cpp

示例7: _tmain

int _tmain(int argc, _TCHAR* argv[])
{
	FT_Library pLibrary = NULL;
					
	//CString strFolder = _T("\\\\mediaserver\\Exchange\\Korshul\\Fonts");
	CString strFolder = _T("X:\\AVS\\Sources\\TeamlabOffice\\trunk\\ServerComponents\\DesktopEditor\\freetype_names\\FontsDictionaryFiles");
	CWinFontList* m_pList = NULL;

	if (!FT_Init_FreeType( &pLibrary ))
	{
		if (_T("") == strFolder)
			m_pList = new CWinFontList(pLibrary);
		else
			m_pList = new CWinFontList(pLibrary, strFolder);

		FT_Done_FreeType( pLibrary );
	}

	CString strFontDictionaryPath = _T("X:\\AVS\\Sources\\TeamlabOffice\\trunk\\ServerComponents\\DesktopEditor\\freetype_names\\FontMaps\\FontDictionary.h");

	int nCount = m_pList->GetFonts()->GetLength();

	// теперь строим массив всех шрифтов по имени
	CAtlMap<CString, CFontInfoJS> mapFonts;
	CAtlMap<CString, CFontInfoJS> mapFontsUnicodes;
	CAtlArray<CString> arrFonts;
	CAtlArray<CString> arrFontsUnicodes;

	int nError = 0;

	CAtlMap<CString, BOOL> mapMainAscii;
	for (int i = 0; i < nCount; ++i)
	{
		CWinFontInfo* pInfo = (CWinFontInfo*)m_pList->GetByIndex(i);
		CString strPath = (CString)pInfo->m_wsFontPath;
		CString strName = (CString)pInfo->m_wsFontName;

		LONG lFontIndex = 0;
		LONG lFaceIndex = 0;

		//CAtlMap<CString, LONG>::CPair* pPairFontFiles = mapFontFiles.Lookup(strPath);
		//lFontIndex = pPairFontFiles->m_value;
		lFontIndex = (LONG)i;

		if (pInfo->m_lIndex >= 0)
			lFaceIndex = pInfo->m_lIndex;

		mapMainAscii.SetAt(pInfo->m_wsFontName, TRUE);

		CAtlMap<CString, CFontInfoJS>::CPair* pPair = mapFonts.Lookup(pInfo->m_wsFontName);
		if (NULL != pPair)
		{
			pPair->m_value.m_sName = pInfo->m_wsFontName;

			if (pInfo->m_bBold && pInfo->m_bItalic)
			{
				if (-1 != pPair->m_value.m_lIndexBI)
					nError++;

				pPair->m_value.m_lIndexBI = lFontIndex;
				pPair->m_value.m_lFaceIndexBI = lFaceIndex;

				pPair->m_value.namesBI.RemoveAll();
				pPair->m_value.namesBI.Copy(pInfo->names);
			}
			else if (pInfo->m_bBold)
			{
				if (-1 != pPair->m_value.m_lIndexB)
					nError++;

				pPair->m_value.m_lIndexB = lFontIndex;
				pPair->m_value.m_lFaceIndexB = lFaceIndex;

				pPair->m_value.namesB.RemoveAll();
				pPair->m_value.namesB.Copy(pInfo->names);
			}
			else if (pInfo->m_bItalic)
			{
				if (-1 != pPair->m_value.m_lIndexI)
					nError++;

				pPair->m_value.m_lIndexI = lFontIndex;
				pPair->m_value.m_lFaceIndexI = lFaceIndex;

				pPair->m_value.namesI.RemoveAll();
				pPair->m_value.namesI.Copy(pInfo->names);
			}
			else
			{
				if (-1 != pPair->m_value.m_lIndexR)
					nError++;

				pPair->m_value.m_lIndexR = lFontIndex;
				pPair->m_value.m_lFaceIndexR = lFaceIndex;

				pPair->m_value.namesR.RemoveAll();
				pPair->m_value.namesR.Copy(pInfo->names);
			}
		}
		else
//.........这里部分代码省略.........
开发者ID:tralivali1234,项目名称:core-1,代码行数:101,代码来源:FontMaps.cpp


注:本文中的CAtlMap::SetAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。