mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
1560c31510
- Changed FolderInfo and WebParser to import pcre_* functions from Rainmeter.dll to reduce binary size - Changed Help in context menu to open Support page (instead of Manual/Manual_beta)
89 lines
1.4 KiB
C++
89 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <windows.h>
|
|
#include "../../Library/pcre-8.10/config.h"
|
|
#include "../../Library/pcre-8.10/pcre.h"
|
|
|
|
namespace PluginFolderInfo {
|
|
|
|
struct FileInfo
|
|
{
|
|
std::wstring Name;
|
|
bool IsFolder;
|
|
UINT64 Size;
|
|
|
|
FileInfo()
|
|
{
|
|
IsFolder = false;
|
|
Size = 0;
|
|
}
|
|
};
|
|
|
|
class FolderInfo
|
|
{
|
|
private:
|
|
bool mySubFolderFlag;
|
|
bool myHiddenFileFlag;
|
|
bool mySystemFileFlag;
|
|
std::wstring myPath;
|
|
UINT64 mySize;
|
|
unsigned int myFileCount;
|
|
unsigned int myFolderCount;
|
|
pcre* myRegExpFilter;
|
|
pcre_extra* myRegExpFilterExtra;
|
|
DWORD myLastUpdateTime;
|
|
|
|
private:
|
|
void Clear();
|
|
void FreePcre();
|
|
void CalculateSize();
|
|
void SetPath(const wchar_t* aPath, const wchar_t* aIniPath);
|
|
|
|
public:
|
|
DWORD GetLastUpdateTime()
|
|
{
|
|
return myLastUpdateTime;
|
|
}
|
|
|
|
void SetRegExpFilter(const wchar_t* aFilter);
|
|
|
|
void IncludeSubFolders(bool aFlag)
|
|
{
|
|
mySubFolderFlag = aFlag;
|
|
}
|
|
|
|
void IncludeHiddenFiles(bool aFlag)
|
|
{
|
|
myHiddenFileFlag = aFlag;
|
|
}
|
|
|
|
void IncludeSystemFiles(bool aFlag)
|
|
{
|
|
mySystemFileFlag = aFlag;
|
|
}
|
|
|
|
UINT64 GetSize()
|
|
{
|
|
return mySize;
|
|
}
|
|
|
|
int GetFileCount()
|
|
{
|
|
return myFileCount;
|
|
}
|
|
|
|
int GetFolderCount()
|
|
{
|
|
return myFolderCount;
|
|
}
|
|
|
|
FolderInfo(const wchar_t* aPath, const wchar_t* aIniPath);
|
|
~FolderInfo();
|
|
|
|
void Update();
|
|
}; // class FolderInfo
|
|
|
|
} // namespace PluginFolderInfo
|