本文整理汇总了C++中CDir::ReadDir方法的典型用法代码示例。如果您正苦于以下问题:C++ CDir::ReadDir方法的具体用法?C++ CDir::ReadDir怎么用?C++ CDir::ReadDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDir
的用法示例。
在下文中一共展示了CDir::ReadDir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OpenPath
void CDlgController::OpenPath(const std::wstring& wstrPath, const std::wstring& wstrFileType)
{
m_wstrPath=wstrPath;
m_wstrFileType=wstrFileType;
m_ListBoxFolder.RemoveAllItems();
//|{"+wstrFileType+L"}";
CDir dir;
if(dir.ReadDir(m_wstrPath)==false)
{
m_wstrPath=getCurrentDirectory();
dir.ReadDir(m_wstrPath);
}
for (int i=0; i<dir.m_FileInfo.size(); i++)
{
if (dir.m_FileInfo[i].IsDirectory())
{
m_ListBoxFolder.AddItem((L'\\'+dir.m_FileInfo[i].wstrFilename).c_str());
}
}
for (int i=0; i<dir.m_FileInfo.size(); i++)
{
if (!dir.m_FileInfo[i].IsDirectory())
{
if (wstrFileType.find(GetExtension(dir.m_FileInfo[i].wstrFilename))!=std::wstring::npos)
{
m_ListBoxFolder.AddItem(dir.m_FileInfo[i].wstrFilename.c_str());
}
}
}
}
示例2: OnInitDialog
bool CDlgModelPlayer::OnInitDialog()
{
m_ComboBoxSkeleton.AddItem(L"");
m_ComboBoxHead.AddItem(L"");
m_ComboBoxSet.AddItem(L"");
for (size_t i=0;i<ET_MAX;++i)
{
m_ComboBoxEquips[i].AddItem(L"");
}
m_ComboBoxLeftHand.AddItem(L"");
m_ComboBoxRightHand.AddItem(L"");
m_ComboBoxBack.AddItem(L"");
std::set<std::wstring> setString;
std::string strDirMU = IniGetStr("WorldEditor.cfg","ResDir","mu");
std::wstring wstrFindPath = s2ws(strDirMU)+L"Player\\";//|{"+wstrFileType+L"}";
CDir dir;
dir.ReadDir(wstrFindPath);
for (size_t i=0; i<dir.m_FileInfo.size(); i++)
{
if (!dir.m_FileInfo[i].IsDirectory())
{
std::wstring wstrFilename = dir.m_FileInfo[i].wstrFilename;
std::transform(wstrFilename.begin(),wstrFilename.end(),wstrFilename.begin(),std::toupper);
//if (wstrFileType.find(GetExtension(dir.m_FileInfo[i].wstrFilename))!=std::wstring::npos)
if (GetExtension(wstrFilename)==L".bmd")
{
if (wstrFilename.find(L"HELMCLASS")!=std::wstring::npos)
{
m_ComboBoxHead.AddItem(wstrFilename.c_str());
}
else if (wstrFilename.find(L"PLAYER")!=std::wstring::npos)
{
m_ComboBoxSkeleton.AddItem(wstrFilename.c_str());
}
else
{
for (size_t i=0;i<ET_MAX;++i)
{
if (wstrFilename.find(s2ws(g_EquipNames[i]))!=std::wstring::npos)
{
m_ComboBoxEquips[i].AddItem(wstrFilename.c_str());
int index=wstrFilename.find(s2ws(g_EquipNames[i]));
wstrFilename.replace(index, strlen(g_EquipNames[i]), L"*");
setString.insert(wstrFilename);
break;
}
}
}
}
}
}
for (std::set<std::wstring>::iterator it=setString.begin();it!=setString.end();it++)
{
m_ComboBoxSet.AddItem(it->c_str());
}
return true;
}
示例3: main
int main(int argc, _TCHAR* argv[])
{
mkdir("Dec");mkdir("Enc");
std::wstring wstrFindPath = getCurrentDirectory();
CDir dir;
dir.ReadDir(wstrFindPath);
for (size_t i=0; i<dir.m_FileInfo.size(); i++)
{
if (!dir.m_FileInfo[i].IsDirectory())
{
std::wstring wstrExt = GetExtension(dir.m_FileInfo[i].wstrFilename);
std::string strFilename = ws2s(dir.m_FileInfo[i].wstrFilename);
if (wstrExt==L".ozj")
{
std::string strDestFilename = "Dec\\"+ChangeExtension(strFilename,".jpg");
fileOffset(strFilename,strDestFilename,24);
}
else if (wstrExt==L".ozt")
{
std::string strDestFilename = "Dec\\"+ChangeExtension(strFilename,".tga");
fileOffset(strFilename,strDestFilename,4);
}
else if (wstrExt==L".ozb")
{
std::string strDestFilename = "Dec\\"+ChangeExtension(strFilename,".bmp");
fileOffset(strFilename,strDestFilename,4);
}
else if (wstrExt==L".jpg")
{
std::string strDestFilename = "Enc\\"+ChangeExtension(strFilename,".ozj");
fileOffset(strFilename,strDestFilename,-24);
}
else if (wstrExt==L".tga")
{
std::string strDestFilename = "Enc\\"+ChangeExtension(strFilename,".ozt");
fileOffset(strFilename,strDestFilename,-4);
}
else if (wstrExt==L".bmp")
{
std::string strDestFilename = "Enc\\"+ChangeExtension(strFilename,".ozb");
fileOffset(strFilename,strDestFilename,-4);
}
else if (wstrExt==L".map"||wstrExt==L".obj")
{
decryptMuFile(strFilename,"Dec\\"+strFilename+"d");
}
else if (wstrExt==L".att")
{
decryptMuATTFile(strFilename,"Dec\\"+strFilename+"d");
}
else if (wstrExt==L".bmd")
{
if ("item.bmd"==strFilename)
{
decryptItemBMD(strFilename,"Dec\\"+ChangeExtension(strFilename,".csv"));
}
else if ("BuffEffect.bmd"==strFilename)
{
decryptBuffEffectFile(strFilename,"Dec\\"+strFilename+"d");
}
//else if (isEncBmd(strFilename))
//{
// decryptMuFile(strFilename,"Dec\\"+strFilename);
//}
else
{
Bmd2Smd(strFilename,"Dec\\"+ChangeExtension(strFilename,".smd"));
// decryptMuFileXOR3(strFilename,"Dec\\"+strFilename);
}
}
else if (wstrExt==L".csv")
{
if ("item.csv"==strFilename)
{
encryptItemBMD(strFilename,"Enc\\"+ChangeExtension(strFilename,".bmd"));
}
}
else if (wstrExt==L".smd")
{
Smd2Bmd(strFilename,"Enc\\"+ChangeExtension(strFilename,".bmd"));
}
}
}
return 0;
}