本文整理汇总了C++中CObjectVector::Delete方法的典型用法代码示例。如果您正苦于以下问题:C++ CObjectVector::Delete方法的具体用法?C++ CObjectVector::Delete怎么用?C++ CObjectVector::Delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CObjectVector
的用法示例。
在下文中一共展示了CObjectVector::Delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SplitFilesToGroups
static void SplitFilesToGroups(
const CCompressionMethodMode &method,
bool useFilters, bool maxFilter,
const CObjectVector<CUpdateItem> &updateItems,
CObjectVector<CSolidGroup> &groups)
{
if (method.Methods.Size() != 1 || method.Binds.Size() != 0)
useFilters = false;
groups.Clear();
groups.Add(CSolidGroup());
groups.Add(CSolidGroup());
CSolidGroup &generalGroup = groups[0];
CSolidGroup &exeGroup = groups[1];
generalGroup.Method = method;
int i;
for (i = 0; i < updateItems.Size(); i++)
{
const CUpdateItem &updateItem = updateItems[i];
if (!updateItem.NewData)
continue;
if (!updateItem.HasStream())
continue;
if (useFilters)
{
const UString name = updateItem.Name;
int dotPos = name.ReverseFind(L'.');
if (dotPos >= 0)
{
UString ext = name.Mid(dotPos + 1);
if (IsExeFile(ext))
{
exeGroup.Indices.Add(i);
continue;
}
}
}
generalGroup.Indices.Add(i);
}
if (exeGroup.Indices.Size() > 0)
if (!MakeExeMethod(method, maxFilter, exeGroup.Method))
exeGroup.Method = method;
for (i = 0; i < groups.Size();)
if (groups[i].Indices.Size() == 0)
groups.Delete(i);
else
i++;
}
示例2: ReadFileFolderPluginInfoList
void ReadFileFolderPluginInfoList(CObjectVector<CPluginInfo> &plugins)
{
ReadPluginInfoList(plugins);
for (int i = 0; i < plugins.Size();)
if (plugins[i].Type != kPluginTypeFF)
plugins.Delete(i);
else
i++;
{
CPluginInfo p;
// p.FilePath.Empty();
p.Type = kPluginTypeFF;
p.Name = L"7-Zip";
// p.ClassID = CLSID_CAgentArchiveHandler;
p.ClassIDDefined = true;
// p.OptionsClassID;
p.OptionsClassIDDefined = false;
plugins.Add(p);
}
}
示例3: OpenFileFolderPlugin
HRESULT OpenFileFolderPlugin(
const UString &path,
HMODULE *module,
IFolderFolder **resultFolder,
HWND parentWindow,
bool &encrypted, UString &password)
{
CObjectVector<CPluginInfo> plugins;
ReadFileFolderPluginInfoList(plugins);
UString extension;
UString name, pureName, dot;
if(!NFile::NDirectory::GetOnlyName(path, name))
return E_FAIL;
NFile::NName::SplitNameToPureNameAndExtension(name, pureName, dot, extension);
int slashPos = path.ReverseFind(WCHAR_PATH_SEPARATOR);
UString dirPrefix;
UString fileName;
if (slashPos >= 0)
{
dirPrefix = path.Left(slashPos + 1);
fileName = path.Mid(slashPos + 1);
}
else
fileName = path;
if (!extension.IsEmpty())
{
CExtInfo extInfo;
if (ReadInternalAssociation(extension, extInfo))
{
for (int i = extInfo.Plugins.Size() - 1; i >= 0; i--)
{
int pluginIndex = FindPlugin(plugins, extInfo.Plugins[i]);
if (pluginIndex >= 0)
{
const CPluginInfo plugin = plugins[pluginIndex];
plugins.Delete(pluginIndex);
plugins.Insert(0, plugin);
}
}
}
}
for (int i = 0; i < plugins.Size(); i++)
{
const CPluginInfo &plugin = plugins[i];
if (!plugin.ClassIDDefined)
continue;
CPluginLibrary library;
CThreadArchiveOpen t;
if (plugin.FilePath.IsEmpty())
t.FolderManager = new CArchiveFolderManager;
else if (library.LoadAndCreateManager(plugin.FilePath, plugin.ClassID, &t.FolderManager) != S_OK)
continue;
t.OpenCallbackSpec = new COpenArchiveCallback;
t.OpenCallback = t.OpenCallbackSpec;
t.OpenCallbackSpec->PasswordIsDefined = encrypted;
t.OpenCallbackSpec->Password = password;
t.OpenCallbackSpec->ParentWindow = parentWindow;
t.OpenCallbackSpec->LoadFileInfo(dirPrefix, fileName);
t.Path = path;
UString progressTitle = LangString(IDS_OPENNING, 0x03020283);
t.OpenCallbackSpec->ProgressDialog.MainWindow = parentWindow;
t.OpenCallbackSpec->ProgressDialog.MainTitle = LangString(IDS_APP_TITLE, 0x03000000);
t.OpenCallbackSpec->ProgressDialog.MainAddTitle = progressTitle + UString(L" ");
NWindows::CThread thread;
if (thread.Create(CThreadArchiveOpen::MyThreadFunction, &t) != S_OK)
throw 271824;
t.OpenCallbackSpec->StartProgressDialog(progressTitle);
if (t.Result == E_ABORT)
return t.Result;
if (t.Result == S_OK)
{
// if (openCallbackSpec->PasswordWasAsked)
{
encrypted = t.OpenCallbackSpec->PasswordIsDefined;
password = t.OpenCallbackSpec->Password;
}
*module = library.Detach();
*resultFolder = t.Folder.Detach();
return S_OK;
}
if (t.Result != S_FALSE)
return t.Result;
}
return S_FALSE;
}
示例4: OpenFileFolderPlugin
HRESULT OpenFileFolderPlugin(
const UString &path,
HMODULE *module,
IFolderFolder **resultFolder,
HWND parentWindow,
bool &encrypted, UString &password)
{
encrypted = false;
#ifdef _WIN32
CObjectVector<CPluginInfo> plugins;
ReadFileFolderPluginInfoList(plugins);
#endif
UString extension;
UString name, pureName, dot;
if(!NFile::NDirectory::GetOnlyName(path, name))
return E_FAIL;
NFile::NName::SplitNameToPureNameAndExtension(name, pureName, dot, extension);
int slashPos = path.ReverseFind(WCHAR_PATH_SEPARATOR);
UString dirPrefix;
UString fileName;
if (slashPos >= 0)
{
dirPrefix = path.Left(slashPos + 1);
fileName = path.Mid(slashPos + 1);
}
else
fileName = path;
#ifdef _WIN32
if (!extension.IsEmpty())
{
CExtInfo extInfo;
if (ReadInternalAssociation(extension, extInfo))
{
for (int i = extInfo.Plugins.Size() - 1; i >= 0; i--)
{
int pluginIndex = FindPlugin(plugins, extInfo.Plugins[i]);
if (pluginIndex >= 0)
{
const CPluginInfo plugin = plugins[pluginIndex];
plugins.Delete(pluginIndex);
plugins.Insert(0, plugin);
}
}
}
}
for (int i = 0; i < plugins.Size(); i++)
{
const CPluginInfo &plugin = plugins[i];
if (!plugin.ClassIDDefined)
continue;
#endif // #ifdef _WIN32
CPluginLibrary library;
CMyComPtr<IFolderManager> folderManager;
CMyComPtr<IFolderFolder> folder;
#ifdef _WIN32
if (plugin.FilePath.IsEmpty())
folderManager = new CArchiveFolderManager;
else if (library.LoadAndCreateManager(plugin.FilePath, plugin.ClassID, &folderManager) != S_OK)
continue;
#else
folderManager = new CArchiveFolderManager;
#endif // #ifdef _WIN32
COpenArchiveCallback *openCallbackSpec = new COpenArchiveCallback;
CMyComPtr<IProgress> openCallback = openCallbackSpec;
openCallbackSpec->PasswordIsDefined = false;
openCallbackSpec->ParentWindow = parentWindow;
openCallbackSpec->LoadFileInfo(dirPrefix, fileName);
HRESULT result = folderManager->OpenFolderFile(path, &folder, openCallback);
if (openCallbackSpec->PasswordWasAsked)
encrypted = true;
if (result == S_OK)
{
*module = library.Detach();
*resultFolder = folder.Detach();
return S_OK;
}
#ifdef _WIN32
continue;
/*
if (result != S_FALSE)
return result;
*/
}
#endif
return S_FALSE;
}