mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-10 06:07:07 -06:00
4.53 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
33ccab7e72
commit
051769bbc5
54
CPP/7zip/UI/FileManager/FilePlugins.h
Executable file
54
CPP/7zip/UI/FileManager/FilePlugins.h
Executable file
@@ -0,0 +1,54 @@
|
||||
// FilePlugins.h
|
||||
|
||||
#ifndef __FILEPLUGINS_H
|
||||
#define __FILEPLUGINS_H
|
||||
|
||||
#include "RegistryPlugins.h"
|
||||
#include "RegistryAssociations.h"
|
||||
|
||||
struct CPluginEnabledPair
|
||||
{
|
||||
int Index;
|
||||
bool Enabled;
|
||||
CPluginEnabledPair(int index, bool enabled): Index(index),Enabled(enabled) {}
|
||||
};
|
||||
|
||||
struct CExtInfoBig
|
||||
{
|
||||
UString Ext;
|
||||
bool Associated;
|
||||
CRecordVector<CPluginEnabledPair> PluginsPairs;
|
||||
int FindPlugin(int pluginIndex)
|
||||
{
|
||||
for (int i = 0; i < PluginsPairs.Size(); i++)
|
||||
if (PluginsPairs[i].Index == pluginIndex)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
};
|
||||
|
||||
class CExtDatabase
|
||||
{
|
||||
public:
|
||||
CObjectVector<CExtInfoBig> ExtBigItems;
|
||||
CObjectVector<CPluginInfo> Plugins;
|
||||
int FindExtInfoBig(const UString &ext);
|
||||
int FindPlugin(const UString &plugin);
|
||||
|
||||
UString GetMainPluginNameForExtItem(int extIndex) const
|
||||
{
|
||||
const CExtInfoBig &extInfo = ExtBigItems[extIndex];
|
||||
if (extInfo.PluginsPairs.IsEmpty())
|
||||
return UString();
|
||||
else
|
||||
return Plugins[extInfo.PluginsPairs.Front().Index].Name;
|
||||
}
|
||||
|
||||
void Read();
|
||||
void Save();
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user