本文整理汇总了C++中AutoAlloc::GetFilename方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoAlloc::GetFilename方法的具体用法?C++ AutoAlloc::GetFilename怎么用?C++ AutoAlloc::GetFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AutoAlloc
的用法示例。
在下文中一共展示了AutoAlloc::GetFilename方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
}
示例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);
}
示例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);
}
}
}
}
}
}
示例4: ReadDistriPrefs
static void ReadDistriPrefs(const Filename &fnDir)
{
AutoAlloc <BrowseFiles> pBrowse;
if (!pBrowse)
return;
Filename fn = fnDir;
Filename fnPreset;
pBrowse->Init(fn, false);
while (pBrowse->GetNext())
{
fnPreset = fn + pBrowse->GetFilename();
ReadPreset(fnPreset);
}
}
示例5: 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);
}