FolderInfo: Changed output when bytes from '10 b' to '10 ' for consistency with AutoScale. Also changed RegExFilter to RegExpFilter for consistency with WebParser.

This commit is contained in:
Birunthan Mohanathas 2010-11-15 15:23:32 +00:00
parent afee54a02f
commit fbb758003d
6 changed files with 34 additions and 213 deletions

View File

@ -9,8 +9,8 @@ FolderInfo::FolderInfo(const wchar_t* aPath)
mySubFolderFlag = false;
myHiddenFileFlag = false;
mySystemFileFlag = false;
myRegExFilter = NULL;
myRegExFilterExtra = NULL;
myRegExpFilter = NULL;
myRegExpFilterExtra = NULL;
myLastUpdateTime = 0;
Clear();
SetPath(aPath);
@ -82,9 +82,9 @@ void FolderInfo::CalculateSize()
else if (!mySystemFileFlag && (findData.dwFileAttributes & FILE_ATTRIBUTE_SYSTEM)) {
continue;
}
else if (!isFolder && myRegExFilter) {
else if (!isFolder && myRegExpFilter) {
int utf8BufLen = WideCharToMultiByte(CP_UTF8, 0, findData.cFileName, wcslen(findData.cFileName) + 1, utf8Buf, MAX_PATH * 3, NULL, NULL);
if (0 != pcre_exec(myRegExFilter, myRegExFilterExtra, utf8Buf, utf8BufLen, 0, 0, NULL, 0)) {
if (0 != pcre_exec(myRegExpFilter, myRegExpFilterExtra, utf8Buf, utf8BufLen, 0, 0, NULL, 0)) {
continue;
}
}
@ -108,12 +108,12 @@ void FolderInfo::CalculateSize()
}
}
void FolderInfo::SetRegExFilter(const wchar_t* aFilter)
void FolderInfo::SetRegExpFilter(const wchar_t* aFilter)
{
if (myRegExFilter) {
pcre_free(myRegExFilter);
myRegExFilter = NULL;
myRegExFilterExtra = NULL;
if (myRegExpFilter) {
pcre_free(myRegExpFilter);
myRegExpFilter = NULL;
myRegExpFilterExtra = NULL;
}
if (aFilter == NULL) {
@ -128,9 +128,9 @@ void FolderInfo::SetRegExFilter(const wchar_t* aFilter)
const char* error;
int erroffset;
myRegExFilter = pcre_compile(buf, PCRE_UTF8, &error, &erroffset, NULL);
if (myRegExFilter) {
myRegExFilterExtra = pcre_study(myRegExFilter, 0, &error);
myRegExpFilter = pcre_compile(buf, PCRE_UTF8, &error, &erroffset, NULL);
if (myRegExpFilter) {
myRegExpFilterExtra = pcre_study(myRegExpFilter, 0, &error);
}
}

View File

@ -30,8 +30,8 @@ private:
UINT64 mySize;
unsigned int myFileCount;
unsigned int myFolderCount;
pcre* myRegExFilter;
pcre_extra* myRegExFilterExtra;
pcre* myRegExpFilter;
pcre_extra* myRegExpFilterExtra;
DWORD myLastUpdateTime;
private:
@ -45,7 +45,7 @@ public:
return myLastUpdateTime;
}
void SetRegExFilter(const wchar_t* aFilter);
void SetRegExpFilter(const wchar_t* aFilter);
void IncludeSubFolders(bool aFlag)
{

View File

@ -146,9 +146,9 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
}
if (measureInfo->Folder) {
const wchar_t* strRegExFilter = ReadConfigString(section, L"RegExFilter", L"");
if (strRegExFilter && wcslen(strRegExFilter) > 0) {
measureInfo->Folder->SetRegExFilter(strRegExFilter);
const wchar_t* strRegExpFilter = ReadConfigString(section, L"RegExpFilter", L"");
if (strRegExpFilter && wcslen(strRegExpFilter) > 0) {
measureInfo->Folder->SetRegExpFilter(strRegExpFilter);
}
const wchar_t* strIncludeSubFolders = ReadConfigString(section, L"IncludeSubFolders", L"");
@ -189,7 +189,7 @@ static void FormatSize(wchar_t* buffer, size_t bufferSize, UINT64 size)
wsprintf(buffer, L"%d.%02d k", (int)(size >> 10), (int)(( size << 54 >> 54 ) / 10.24));
}
else {
wsprintf(buffer, L"%ld b", size);
wsprintf(buffer, L"%ld ", size);
}
}
@ -292,7 +292,7 @@ void Finalize(HMODULE instance, UINT id)
*/
UINT GetPluginVersion()
{
return 0001;
return 0002;
}
/*

View File

@ -76,12 +76,13 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib gdiplus.lib Rainmeter.lib"
OutputFile="../../TestBench/x32/Debug/Plugins/FolderInfo.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\x32/Debug/FolderInfoPlugin.pdb"
ImportLibrary=".\x32/Debug/FolderInfoPlugin.lib"
ProgramDatabaseFile=".\x32/Debug/FolderInfo.pdb"
ImportLibrary=".\x32/Debug/FolderInfo.lib"
TargetMachine="1"
/>
<Tool
@ -165,12 +166,13 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib gdiplus.lib Rainmeter.lib"
OutputFile="../../TestBench/x64/Debug/Plugins/FolderInfo.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\x64/Debug/FolderInfoPlugin.pdb"
ImportLibrary=".\x64/Debug/FolderInfoPlugin.lib"
ProgramDatabaseFile=".\x64/Debug/FolderInfo.pdb"
ImportLibrary=".\x64/Debug/FolderInfo.lib"
TargetMachine="17"
/>
<Tool
@ -256,7 +258,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/machine:AMD64 /LTCG "
AdditionalDependencies="bufferoverflowU.lib odbc32.lib odbccp32.lib"
AdditionalDependencies="odbc32.lib odbccp32.lib Rainmeter.lib"
OutputFile="../../TestBench/x64/Release/Plugins/FolderInfo.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
@ -347,13 +349,13 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/machine:AMD64 /LTCG "
AdditionalDependencies="odbc32.lib odbccp32.lib Rainmeter.lib"
AdditionalDependencies="odbc32.lib odbccp32.lib Rainmeter.lib comctl32.lib"
OutputFile="../../TestBench/x64/Release/Plugins/FolderInfo.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\Library\x64\Release"
ProgramDatabaseFile=".\x64/Release/FolderInfoPlugin.pdb"
ImportLibrary=".\x64/Release/FolderInfoPlugin.lib"
ProgramDatabaseFile=".\x64/Release/FolderInfo.pdb"
ImportLibrary=".\x64/Release/FolderInfo.lib"
TargetMachine="17"
/>
<Tool
@ -439,14 +441,14 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Rainmeter.lib"
AdditionalDependencies="Rainmeter.lib comctl32.lib gdiplus.lib"
OutputFile="../../TestBench/x32/Release/Plugins/FolderInfo.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\Library\x32\Release"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\x32/Release/FolderInfoPlugin.pdb"
ImportLibrary=".\x32/Release/FolderInfoPlugin.lib"
ProgramDatabaseFile=".\x32/Release/FolderInfo.pdb"
ImportLibrary=".\x32/Release/FolderInfo.lib"
TargetMachine="1"
/>
<Tool
@ -531,6 +533,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Rainmeter.lib comctl32.lib gdiplus.lib"
OutputFile="../../TestBench/x32/Release/Plugins/FolderInfo.dll"
LinkIncremental="1"
SuppressStartupBanner="true"

View File

@ -1,177 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="9.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="WINDOWS"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Debug|x64"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="WINDOWS"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release64|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="WINDOWS"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release64|x64"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="WINDOWS"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="WINDOWS"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|x64"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="WINDOWS"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -130,7 +130,6 @@ Global
{BE9D2400-7F1C-49D6-8498-5CE495491AD6}.Release|Win32.ActiveCfg = Release|Win32
{BE9D2400-7F1C-49D6-8498-5CE495491AD6}.Release|Win32.Build.0 = Release|Win32
{BE9D2400-7F1C-49D6-8498-5CE495491AD6}.Release|x64.ActiveCfg = Release|x64
{BE9D2400-7F1C-49D6-8498-5CE495491AD6}.Release|x64.Build.0 = Release|x64
{BE9D2400-7F1C-49D6-8498-5CE495491AD6}.Release64|Win32.ActiveCfg = Release64|Win32
{BE9D2400-7F1C-49D6-8498-5CE495491AD6}.Release64|Win32.Build.0 = Release64|Win32
{BE9D2400-7F1C-49D6-8498-5CE495491AD6}.Release64|x64.ActiveCfg = Release64|x64
@ -307,7 +306,6 @@ Global
{6D032D6B-7656-4743-B454-3388E2921EB0}.Release|Win32.ActiveCfg = Release|Win32
{6D032D6B-7656-4743-B454-3388E2921EB0}.Release|Win32.Build.0 = Release|Win32
{6D032D6B-7656-4743-B454-3388E2921EB0}.Release|x64.ActiveCfg = Release|x64
{6D032D6B-7656-4743-B454-3388E2921EB0}.Release|x64.Build.0 = Release|x64
{6D032D6B-7656-4743-B454-3388E2921EB0}.Release64|Win32.ActiveCfg = Release64|Win32
{6D032D6B-7656-4743-B454-3388E2921EB0}.Release64|Win32.Build.0 = Release64|Win32
{6D032D6B-7656-4743-B454-3388E2921EB0}.Release64|x64.ActiveCfg = Release64|x64
@ -319,7 +317,6 @@ Global
{4640AB3A-5A8B-2DA0-980C-A70BCAB3A7F1}.Release|Win32.ActiveCfg = Release|Win32
{4640AB3A-5A8B-2DA0-980C-A70BCAB3A7F1}.Release|Win32.Build.0 = Release|Win32
{4640AB3A-5A8B-2DA0-980C-A70BCAB3A7F1}.Release|x64.ActiveCfg = Release|x64
{4640AB3A-5A8B-2DA0-980C-A70BCAB3A7F1}.Release|x64.Build.0 = Release|x64
{4640AB3A-5A8B-2DA0-980C-A70BCAB3A7F1}.Release64|Win32.ActiveCfg = Release64|Win32
{4640AB3A-5A8B-2DA0-980C-A70BCAB3A7F1}.Release64|Win32.Build.0 = Release64|Win32
{4640AB3A-5A8B-2DA0-980C-A70BCAB3A7F1}.Release64|x64.ActiveCfg = Release64|x64
@ -331,7 +328,6 @@ Global
{EB48A04A-657E-41B8-B2F5-D47F8C30B2B4}.Release|Win32.ActiveCfg = Release|Win32
{EB48A04A-657E-41B8-B2F5-D47F8C30B2B4}.Release|Win32.Build.0 = Release|Win32
{EB48A04A-657E-41B8-B2F5-D47F8C30B2B4}.Release|x64.ActiveCfg = Release|x64
{EB48A04A-657E-41B8-B2F5-D47F8C30B2B4}.Release|x64.Build.0 = Release|x64
{EB48A04A-657E-41B8-B2F5-D47F8C30B2B4}.Release64|Win32.ActiveCfg = Release64|Win32
{EB48A04A-657E-41B8-B2F5-D47F8C30B2B4}.Release64|Win32.Build.0 = Release64|Win32
{EB48A04A-657E-41B8-B2F5-D47F8C30B2B4}.Release64|x64.ActiveCfg = Release64|x64
@ -343,7 +339,6 @@ Global
{A221819D-4263-42AA-B22A-C022924842A7}.Release|Win32.ActiveCfg = Release|Win32
{A221819D-4263-42AA-B22A-C022924842A7}.Release|Win32.Build.0 = Release|Win32
{A221819D-4263-42AA-B22A-C022924842A7}.Release|x64.ActiveCfg = Release|x64
{A221819D-4263-42AA-B22A-C022924842A7}.Release|x64.Build.0 = Release|x64
{A221819D-4263-42AA-B22A-C022924842A7}.Release64|Win32.ActiveCfg = Release64|Win32
{A221819D-4263-42AA-B22A-C022924842A7}.Release64|Win32.Build.0 = Release64|Win32
{A221819D-4263-42AA-B22A-C022924842A7}.Release64|x64.ActiveCfg = Release64|x64