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


C++ AutoAlloc::IsDir方法代码示例

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


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

示例1: BrowsePath

/*********************************************************************\
	Function name    : CResEditBrowser::BrowsePath
	Description      :
	Created at       : 26.09.01, @ 11:59:42
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CResEditBrowser::BrowsePath(Filename fn)
{
	AutoAlloc <BrowseFiles> pBrowse;
	pBrowse->Init(fn, false);

	Filename fnBrowse;
	TreeViewItem* pNewItem;

	//TRACE_STRING(fn.GetString());

	while (pBrowse->GetNext())
	{
		fnBrowse = pBrowse->GetFilename();
		if (pBrowse->IsDir())
		{
			BrowsePath(fn + fnBrowse);
			continue;
		}
		pNewItem = nullptr;
		if (fnBrowse.CheckSuffix("res"))
			pNewItem = m_wndTreeView.AddItem(fnBrowse.GetFileString(), m_pDialogsItem);
		else if (fnBrowse.CheckSuffix("tif") || fnBrowse.CheckSuffix("jpg") || fnBrowse.CheckSuffix("bmp"))
			pNewItem = m_wndTreeView.AddItem(fnBrowse.GetFileString(), m_pImagesItem);

		if (pNewItem)
			pNewItem->GetData()->SetString(ITEM_PATH_NAME, (fn + fnBrowse).GetString());
	}
}
开发者ID:nr-plugins,项目名称:resedit,代码行数:35,代码来源:ResEditBrowser.cpp

示例2: Init

/*********************************************************************\
	Function name    : CLanguageList::Init
	Description      :
	Created at       : 26.09.01, @ 16:11:23
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CLanguageList::Init()
{
	Filename resourcepath = GeGetStartupPath() + Filename("resource");

	if (GetC4DVersion() >= 16000) {
		// R16 has a new resource directory structure. The c4d_language.str
		// files we are searching for are in resource/modules/c4dplugin/strings_xx.
		// Fix for https://github.com/nr-plugins/resedit/issues/4
		resourcepath = resourcepath + "modules" + "c4dplugin";
	}

	AutoAlloc <BrowseFiles> pBrowse;
	pBrowse->Init(resourcepath, false);

	while (pBrowse->GetNext())
	{
		if (pBrowse->IsDir())
		{
			Filename fn = pBrowse->GetFilename();
			if (fn.GetString().SubStr(0, 8).ToLower() == "strings_")
			{
				String idx = fn.GetString();
				idx.Delete(0, 8);

				Filename stringname = resourcepath + fn+Filename("c4d_language.str");
				AutoAlloc <BaseFile> pFile;
				if (!pFile)
					return;
				if (!GeFExist(stringname))
				{
					GeOutString("Missing c4d_language.str to identify the string directory!!!", GEMB_ICONEXCLAMATION);
				}
				else if (pFile->Open(stringname))
				{
					Int32 len = pFile->GetLength();
					Char *buffer = NewMemClear(Char,len + 2);
					if (buffer)
					{
						pFile->ReadBytes(buffer,len);
						buffer[len]=0;

						Int32 i;

						for (i = 0; i < len && buffer[i] >= ' '; i++) { }
						buffer[i] = 0;

						for (i--; i > 0 && buffer[i]== ' '; i--) { }
						buffer[i + 1] = 0;

						AddLanguage(buffer, idx);
						DeleteMem(buffer);
					}
				}
			}
		}
	}

	CriticalAssert(GetNumLanguages() > 0);
}
开发者ID:nr-plugins,项目名称:resedit,代码行数:66,代码来源:LanguageList.cpp

示例3: Init

/*********************************************************************\
	Function name    : CLanguageList::Init
	Description      :
	Created at       : 26.09.01, @ 16:11:23
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CLanguageList::Init()
{
	Filename resourcepath = GeGetStartupPath() + Filename("resource");
	AutoAlloc <BrowseFiles> pBrowse;
	pBrowse->Init(resourcepath, false);

	while (pBrowse->GetNext())
	{
		if (pBrowse->IsDir())
		{
			Filename fn = pBrowse->GetFilename();
			if (fn.GetString().SubStr(0, 8).ToLower() == "strings_")
			{
				String idx = fn.GetString();
				idx.Delete(0, 8);

				Filename stringname = resourcepath + fn+Filename("c4d_language.str");
				AutoAlloc <BaseFile> pFile;
				if (!pFile)
					return;
				if (!GeFExist(stringname))
				{
					GeOutString("Missing c4d_language.str to identify the string directory!!!", GEMB_ICONEXCLAMATION);
				}
				else if (pFile->Open(stringname))
				{
					Int32 len = pFile->GetLength();
					Char *buffer = NewMemClear(Char,len + 2);
					if (buffer)
					{
						pFile->ReadBytes(buffer,len);
						buffer[len]=0;

						Int32 i;

						for (i = 0; i < len && buffer[i] >= ' '; i++) { }
						buffer[i] = 0;

						for (i--; i > 0 && buffer[i]== ' '; i--) { }
						buffer[i + 1] = 0;

						AddLanguage(buffer, idx);
						DeleteMem(buffer);
					}
				}
			}
		}
	}
}
开发者ID:phohale,项目名称:ResEdit,代码行数:56,代码来源:LanguageList.cpp

示例4: FillList

/*********************************************************************\
	Function name    : CResEditBrowser::FillList
	Description      :
	Created at       : 25.09.01, @ 22:58:07
	Created by       : Thomas Kunert
	Modified by      :
\*********************************************************************/
void CResEditBrowser::FillList()
{
	SetTitle(GeLoadString(IDS_BROWSER_CAPT) + " - " + m_strPath.GetString());
	GeShowMouse(MOUSE_BUSY);

	m_wndTreeView.LockWindowUpdate();
	m_wndTreeView.Reset();

	m_pDialogsItem = m_wndTreeView.AddItem(GeLoadString(IDS_BROWSER_DIALOGS));
	m_pImagesItem = m_wndTreeView.AddItem(GeLoadString(IDS_BROWSER_IMAGES));
	m_pStringTablesItem = m_wndTreeView.AddItem(GeLoadString(IDS_BROWSER_STRIG_TABLES));

	BrowsePath(m_strPath);

	// add global string table(s)
	CDoubleLinkedList <CStringTableName> stringList;

	AutoAlloc <BrowseFiles> pBrowse;
	pBrowse->Init(m_strPath, false);
	while (pBrowse->GetNext())
	{
		if (!pBrowse->IsDir()) continue;

		Filename fnNew = pBrowse->GetFilename();

		if (fnNew.GetString().SubStr(0, 8).ToLower() == "strings_")
		{
			Filename fnStringTable = m_strPath + fnNew;
			TRACE("Found string table path ");
			//TRACE_STRING(fnStringTable.GetString());

			AutoAlloc <BrowseFiles> pBrowseTable;
			pBrowseTable->Init(fnStringTable, false);

			while (pBrowseTable->GetNext())
			{
				Filename fnTable = pBrowseTable->GetFilename();
				if (fnTable.CheckSuffix("str"))
				{
					TRACE("  ");
					//TRACE_STRING(fnTable.GetString());

					String strNewName = fnTable.GetString();
					// check, if we didn't find this table before

					CStringTableName *pSearch = stringList.First();
					Bool bFound = false;
					while (pSearch)
					{
						if (pSearch->strName == strNewName)
						{
							bFound = true;
							break;
						}
						pSearch = stringList.Next(pSearch);
					}
					if (bFound) continue;

					CStringTableName *pNewItem = NewObjClear(CStringTableName);
					pNewItem->strName = strNewName;
					stringList.Append(pNewItem);
				}
			}
		}
	}

	CStringTableName *pInsert = stringList.First();
	while (pInsert)
	{
		TreeViewItem* pNewItem = m_wndTreeView.AddItem(pInsert->strName, m_pStringTablesItem);
		pNewItem->GetData()->SetString(ITEM_PATH_NAME, pInsert->strName);
		pInsert = stringList.Next(pInsert);
	}
	stringList.FreeList();

	m_wndTreeView.SortChildren(m_pDialogsItem);
	m_wndTreeView.SortChildren(m_pImagesItem);
	m_wndTreeView.SortChildren(m_pStringTablesItem);

	m_wndTreeView.UnlockWindowUpdate();

	GeShowMouse(MOUSE_NORMAL);
}
开发者ID:nr-plugins,项目名称:resedit,代码行数:90,代码来源:ResEditBrowser.cpp


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