mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 10:07:02 -06:00
9.21
This commit is contained in:
committed by
Kornel Lesiński
parent
de4f8c22fe
commit
35596517f2
@@ -1,9 +1,13 @@
|
||||
// Common/C_FileIO.h
|
||||
// Common/C_FileIO.cpp
|
||||
|
||||
#include "C_FileIO.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#ifdef _WIN32
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
namespace NC {
|
||||
namespace NFile {
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
#include "Types.h"
|
||||
#include "MyWindows.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef size_t ssize_t;
|
||||
#endif
|
||||
|
||||
namespace NC {
|
||||
namespace NFile {
|
||||
namespace NIO {
|
||||
|
||||
@@ -48,7 +48,7 @@ static int CompareLangItems(void *const *elem1, void *const *elem2, void *)
|
||||
return MyCompare(langPair1.Value, langPair2.Value);
|
||||
}
|
||||
|
||||
bool CLang::Open(LPCWSTR fileName)
|
||||
bool CLang::Open(CFSTR fileName)
|
||||
{
|
||||
_langPairs.Clear();
|
||||
NWindows::NFile::NIO::CInFile file;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#ifndef __COMMON_LANG_H
|
||||
#define __COMMON_LANG_H
|
||||
|
||||
#include "MyVector.h"
|
||||
#include "MyString.h"
|
||||
#include "Types.h"
|
||||
|
||||
@@ -17,7 +16,7 @@ class CLang
|
||||
{
|
||||
CObjectVector<CLangPair> _langPairs;
|
||||
public:
|
||||
bool Open(LPCWSTR fileName);
|
||||
bool Open(CFSTR fileName);
|
||||
void Clear() { _langPairs.Clear(); }
|
||||
int FindItem(UInt32 value) const;
|
||||
bool GetMessage(UInt32 value, UString &message) const;
|
||||
|
||||
@@ -9,15 +9,16 @@
|
||||
#include "StringConvert.h"
|
||||
#include "UTFConvert.h"
|
||||
|
||||
static const char kQuoteChar = '\"';
|
||||
static const char kQuoteChar = '\"';
|
||||
|
||||
static void RemoveQuote(UString &s)
|
||||
{
|
||||
if (s.Length() >= 2)
|
||||
if (s[0] == kQuoteChar && s[s.Length() - 1] == kQuoteChar)
|
||||
if (s[0] == kQuoteChar && s.Back() == kQuoteChar)
|
||||
s = s.Mid(1, s.Length() - 2);
|
||||
}
|
||||
|
||||
bool ReadNamesFromListFile(LPCWSTR fileName, UStringVector &resultStrings, UINT codePage)
|
||||
bool ReadNamesFromListFile(CFSTR fileName, UStringVector &resultStrings, UINT codePage)
|
||||
{
|
||||
NWindows::NFile::NIO::CInFile file;
|
||||
if (!file.Open(fileName))
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Common/ListFileUtils.h
|
||||
|
||||
#ifndef __COMMON_LISTFILEUTILS_H
|
||||
#define __COMMON_LISTFILEUTILS_H
|
||||
#ifndef __COMMON_LIST_FILE_UTILS_H
|
||||
#define __COMMON_LIST_FILE_UTILS_H
|
||||
|
||||
#include "MyString.h"
|
||||
#include "Types.h"
|
||||
|
||||
bool ReadNamesFromListFile(LPCWSTR fileName, UStringVector &strings, UINT codePage = CP_OEMCP);
|
||||
bool ReadNamesFromListFile(CFSTR fileName, UStringVector &strings, UINT codePage = CP_OEMCP);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#ifndef _WIN32
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
|
||||
@@ -12,10 +14,75 @@
|
||||
|
||||
#include "MyString.h"
|
||||
|
||||
const char* MyStringGetNextCharPointer(const char *p)
|
||||
{
|
||||
#if defined(_WIN32) && !defined(UNDER_CE)
|
||||
return CharNextA(p);
|
||||
#else
|
||||
return p + 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
int FindCharPosInString(const char *s, char c)
|
||||
{
|
||||
for (const char *p = s;;)
|
||||
{
|
||||
if (*p == c)
|
||||
return (int)(p - s);
|
||||
if (*p == 0)
|
||||
return -1;
|
||||
p = MyStringGetNextCharPointer(p);
|
||||
}
|
||||
}
|
||||
|
||||
int FindCharPosInString(const wchar_t *s, wchar_t c)
|
||||
{
|
||||
for (const wchar_t *p = s;; p++)
|
||||
{
|
||||
if (*p == c)
|
||||
return (int)(p - s);
|
||||
if (*p == 0)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#ifndef _UNICODE
|
||||
#ifdef _UNICODE
|
||||
|
||||
wchar_t MyCharUpper(wchar_t c)
|
||||
{
|
||||
return (wchar_t)(unsigned int)(UINT_PTR)CharUpperW((LPWSTR)(UINT_PTR)(unsigned int)c);
|
||||
}
|
||||
|
||||
/*
|
||||
wchar_t MyCharLower(wchar_t c)
|
||||
{
|
||||
return (wchar_t)(unsigned int)(UINT_PTR)CharLowerW((LPWSTR)(UINT_PTR)(unsigned int)c);
|
||||
}
|
||||
|
||||
char MyCharLower(char c)
|
||||
#ifdef UNDER_CE
|
||||
{ return (char)MyCharLower((wchar_t)c); }
|
||||
#else
|
||||
{ return (char)(unsigned int)(UINT_PTR)CharLowerA((LPSTR)(UINT_PTR)(unsigned int)(unsigned char)c); }
|
||||
#endif
|
||||
*/
|
||||
|
||||
wchar_t * MyStringUpper(wchar_t *s) { return CharUpperW(s); }
|
||||
wchar_t * MyStringLower(wchar_t *s) { return CharLowerW(s); }
|
||||
|
||||
// for WinCE - FString - char
|
||||
const char *MyStringGetPrevCharPointer(const char * /* base */, const char *p)
|
||||
{
|
||||
return p - 1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
const char * MyStringGetPrevCharPointer(const char *base, const char *p) { return CharPrevA(base, p); }
|
||||
char * MyStringUpper(char *s) { return CharUpperA(s); }
|
||||
char * MyStringLower(char *s) { return CharLowerA(s); }
|
||||
|
||||
wchar_t MyCharUpper(wchar_t c)
|
||||
{
|
||||
@@ -62,7 +129,8 @@ wchar_t * MyStringUpper(wchar_t *s)
|
||||
return res;
|
||||
AString a = UnicodeStringToMultiByte(s);
|
||||
a.MakeUpper();
|
||||
return MyStringCopy(s, (const wchar_t *)MultiByteToUnicodeString(a));
|
||||
MyStringCopy(s, (const wchar_t *)MultiByteToUnicodeString(a));
|
||||
return s;
|
||||
}
|
||||
|
||||
wchar_t * MyStringLower(wchar_t *s)
|
||||
@@ -74,57 +142,12 @@ wchar_t * MyStringLower(wchar_t *s)
|
||||
return res;
|
||||
AString a = UnicodeStringToMultiByte(s);
|
||||
a.MakeLower();
|
||||
return MyStringCopy(s, (const wchar_t *)MultiByteToUnicodeString(a));
|
||||
MyStringCopy(s, (const wchar_t *)MultiByteToUnicodeString(a));
|
||||
return s;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
inline int ConvertCompareResult(int r) { return r - 2; }
|
||||
|
||||
int MyStringCollate(const wchar_t *s1, const wchar_t *s2)
|
||||
{
|
||||
int res = CompareStringW(
|
||||
LOCALE_USER_DEFAULT, SORT_STRINGSORT, s1, -1, s2, -1);
|
||||
#ifdef _UNICODE
|
||||
return ConvertCompareResult(res);
|
||||
#else
|
||||
if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
|
||||
return ConvertCompareResult(res);
|
||||
return MyStringCollate(UnicodeStringToMultiByte(s1),
|
||||
UnicodeStringToMultiByte(s2));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef UNDER_CE
|
||||
int MyStringCollate(const char *s1, const char *s2)
|
||||
{
|
||||
return ConvertCompareResult(CompareStringA(
|
||||
LOCALE_USER_DEFAULT, SORT_STRINGSORT, s1, -1, s2, -1));
|
||||
}
|
||||
|
||||
int MyStringCollateNoCase(const char *s1, const char *s2)
|
||||
{
|
||||
return ConvertCompareResult(CompareStringA(
|
||||
LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, s1, -1, s2, -1));
|
||||
}
|
||||
#endif
|
||||
|
||||
int MyStringCollateNoCase(const wchar_t *s1, const wchar_t *s2)
|
||||
{
|
||||
int res = CompareStringW(
|
||||
LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, s1, -1, s2, -1);
|
||||
#ifdef _UNICODE
|
||||
return ConvertCompareResult(res);
|
||||
#else
|
||||
if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
|
||||
return ConvertCompareResult(res);
|
||||
return MyStringCollateNoCase(UnicodeStringToMultiByte(s1),
|
||||
UnicodeStringToMultiByte(s2));
|
||||
#endif
|
||||
}
|
||||
*/
|
||||
|
||||
#else
|
||||
|
||||
wchar_t MyCharUpper(wchar_t c)
|
||||
@@ -132,6 +155,15 @@ wchar_t MyCharUpper(wchar_t c)
|
||||
return toupper(c);
|
||||
}
|
||||
|
||||
wchar_t * MyStringUpper(wchar_t *s)
|
||||
{
|
||||
if (s == 0)
|
||||
return 0;
|
||||
for (wchar_t *p = s; *p != 0; p++)
|
||||
*p = MyCharUpper(*p);
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
int MyStringCollateNoCase(const wchar_t *s1, const wchar_t *s2)
|
||||
{
|
||||
@@ -192,9 +224,45 @@ int MyStringCompareNoCase(const wchar_t *s1, const wchar_t *s2)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
UString MultiByteToUnicodeString(const AString &srcString, UINT codePage);
|
||||
AString UnicodeStringToMultiByte(const UString &srcString, UINT codePage);
|
||||
|
||||
int MyStringCompareNoCase(const char *s1, const char *s2)
|
||||
{
|
||||
return MyStringCompareNoCase(MultiByteToUnicodeString(s1), MultiByteToUnicodeString(s2));
|
||||
return MyStringCompareNoCase(MultiByteToUnicodeString(s1, CP_ACP), MultiByteToUnicodeString(s2, CP_ACP));
|
||||
}
|
||||
*/
|
||||
|
||||
static inline UINT GetCurrentCodePage()
|
||||
{
|
||||
#if defined(UNDER_CE) || !defined(defined)
|
||||
return CP_ACP;
|
||||
#else
|
||||
return ::AreFileApisANSI() ? CP_ACP : CP_OEMCP;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef USE_UNICODE_FSTRING
|
||||
|
||||
AString fs2fas(CFSTR s)
|
||||
{
|
||||
return UnicodeStringToMultiByte(s, GetCurrentCodePage());
|
||||
}
|
||||
|
||||
FString fas2fs(const AString &s)
|
||||
{
|
||||
return MultiByteToUnicodeString(s, GetCurrentCodePage());
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
UString fs2us(const FString &s)
|
||||
{
|
||||
return MultiByteToUnicodeString((AString)s, GetCurrentCodePage());
|
||||
}
|
||||
|
||||
FString us2fs(const wchar_t *s)
|
||||
{
|
||||
return UnicodeStringToMultiByte(s, GetCurrentCodePage());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "Types.h"
|
||||
#include "MyVector.h"
|
||||
|
||||
template <class T>
|
||||
@@ -16,13 +17,14 @@ inline int MyStringLen(const T *s)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline T * MyStringCopy(T *dest, const T *src)
|
||||
inline void MyStringCopy(T *dest, const T *src)
|
||||
{
|
||||
T *destStart = dest;
|
||||
while ((*dest++ = *src++) != 0);
|
||||
return destStart;
|
||||
}
|
||||
|
||||
int FindCharPosInString(const char *s, char c);
|
||||
int FindCharPosInString(const wchar_t *s, wchar_t c);
|
||||
|
||||
inline wchar_t* MyStringGetNextCharPointer(wchar_t *p)
|
||||
{ return (p + 1); }
|
||||
inline const wchar_t* MyStringGetNextCharPointer(const wchar_t *p)
|
||||
@@ -32,77 +34,25 @@ inline wchar_t* MyStringGetPrevCharPointer(const wchar_t *, wchar_t *p)
|
||||
inline const wchar_t* MyStringGetPrevCharPointer(const wchar_t *, const wchar_t *p)
|
||||
{ return (p - 1); }
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
inline const char* MyStringGetNextCharPointer(const char *p)
|
||||
{
|
||||
#ifdef UNDER_CE
|
||||
return p + 1;
|
||||
#else
|
||||
return CharNextA(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
inline const char* MyStringGetPrevCharPointer(const char *base, const char *p)
|
||||
{ return CharPrevA(base, p); }
|
||||
|
||||
inline char MyCharUpper(char c)
|
||||
{ return (char)(unsigned int)(UINT_PTR)CharUpperA((LPSTR)(UINT_PTR)(unsigned int)(unsigned char)c); }
|
||||
#ifdef _UNICODE
|
||||
inline wchar_t MyCharUpper(wchar_t c)
|
||||
{ return (wchar_t)(unsigned int)(UINT_PTR)CharUpperW((LPWSTR)(UINT_PTR)(unsigned int)c); }
|
||||
#else
|
||||
wchar_t MyCharUpper(wchar_t c);
|
||||
#endif
|
||||
// wchar_t MyCharLower(wchar_t c);
|
||||
|
||||
#ifdef _UNICODE
|
||||
inline wchar_t MyCharLower(wchar_t c)
|
||||
{ return (wchar_t)(unsigned int)(UINT_PTR)CharLowerW((LPWSTR)(UINT_PTR)(unsigned int)c); }
|
||||
#else
|
||||
wchar_t MyCharLower(wchar_t c);
|
||||
#endif
|
||||
char *MyStringUpper(char *s);
|
||||
char *MyStringLower(char *s);
|
||||
|
||||
inline char MyCharLower(char c)
|
||||
#ifdef UNDER_CE
|
||||
{ return (char)MyCharLower((wchar_t)c); }
|
||||
#else
|
||||
{ return (char)(unsigned int)(UINT_PTR)CharLowerA((LPSTR)(UINT_PTR)(unsigned int)(unsigned char)c); }
|
||||
#endif
|
||||
wchar_t *MyStringUpper(wchar_t *s);
|
||||
wchar_t *MyStringLower(wchar_t *s);
|
||||
|
||||
inline char * MyStringUpper(char *s) { return CharUpperA(s); }
|
||||
#ifdef _UNICODE
|
||||
inline wchar_t * MyStringUpper(wchar_t *s) { return CharUpperW(s); }
|
||||
#else
|
||||
wchar_t * MyStringUpper(wchar_t *s);
|
||||
#endif
|
||||
|
||||
inline char * MyStringLower(char *s) { return CharLowerA(s); }
|
||||
#ifdef _UNICODE
|
||||
inline wchar_t * MyStringLower(wchar_t *s) { return CharLowerW(s); }
|
||||
#else
|
||||
wchar_t * MyStringLower(wchar_t *s);
|
||||
#endif
|
||||
|
||||
#else // Standard-C
|
||||
wchar_t MyCharUpper(wchar_t c);
|
||||
#endif
|
||||
const char* MyStringGetNextCharPointer(const char *p);
|
||||
const char* MyStringGetPrevCharPointer(const char *base, const char *p);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Compare
|
||||
|
||||
/*
|
||||
#ifndef UNDER_CE
|
||||
int MyStringCollate(const char *s1, const char *s2);
|
||||
int MyStringCollateNoCase(const char *s1, const char *s2);
|
||||
#endif
|
||||
int MyStringCollate(const wchar_t *s1, const wchar_t *s2);
|
||||
int MyStringCollateNoCase(const wchar_t *s1, const wchar_t *s2);
|
||||
*/
|
||||
|
||||
int MyStringCompare(const char *s1, const char *s2);
|
||||
int MyStringCompare(const wchar_t *s1, const wchar_t *s2);
|
||||
|
||||
// int MyStringCompareNoCase(const char *s1, const char *s2);
|
||||
int MyStringCompareNoCase(const char *s1, const char *s2);
|
||||
int MyStringCompareNoCase(const wchar_t *s1, const wchar_t *s2);
|
||||
|
||||
template <class T>
|
||||
@@ -338,10 +288,8 @@ public:
|
||||
return Mid(_length - count, count);
|
||||
}
|
||||
|
||||
void MakeUpper()
|
||||
{ MyStringUpper(_chars); }
|
||||
void MakeLower()
|
||||
{ MyStringLower(_chars); }
|
||||
void MakeUpper() { MyStringUpper(_chars); }
|
||||
void MakeLower() { MyStringLower(_chars); }
|
||||
|
||||
int Compare(const CStringBase& s) const
|
||||
{ return MyStringCompare(_chars, s._chars); }
|
||||
@@ -362,18 +310,11 @@ public:
|
||||
{ return MyStringCollateNoCase(_chars, s._chars); }
|
||||
*/
|
||||
|
||||
int Find(T c) const { return Find(c, 0); }
|
||||
int Find(T c) const { return FindCharPosInString(_chars, c); }
|
||||
int Find(T c, int startIndex) const
|
||||
{
|
||||
const T *p = _chars + startIndex;
|
||||
for (;;)
|
||||
{
|
||||
if (*p == c)
|
||||
return (int)(p - _chars);
|
||||
if (*p == 0)
|
||||
return -1;
|
||||
p = GetNextCharPointer(p);
|
||||
}
|
||||
int pos = FindCharPosInString(_chars + startIndex, c);
|
||||
return pos < 0 ? -1 : pos + startIndex;
|
||||
}
|
||||
int Find(const CStringBase &s) const { return Find(s, 0); }
|
||||
int Find(const CStringBase &s, int startIndex) const
|
||||
@@ -622,4 +563,47 @@ typedef CObjectVector<UString> UStringVector;
|
||||
|
||||
typedef CObjectVector<CSysString> CSysStringVector;
|
||||
|
||||
|
||||
// ---------- FString ----------
|
||||
|
||||
#ifdef _WIN32
|
||||
#define USE_UNICODE_FSTRING
|
||||
#endif
|
||||
|
||||
#ifdef USE_UNICODE_FSTRING
|
||||
|
||||
#define __FTEXT(quote) L##quote
|
||||
|
||||
typedef wchar_t FChar;
|
||||
typedef UString FString;
|
||||
|
||||
#define fs2us(_x_) (_x_)
|
||||
#define us2fs(_x_) (_x_)
|
||||
FString fas2fs(const AString &s);
|
||||
AString fs2fas(const FChar *s);
|
||||
|
||||
#else
|
||||
|
||||
#define __FTEXT(quote) quote
|
||||
|
||||
typedef char FChar;
|
||||
typedef AString FString;
|
||||
|
||||
UString fs2us(const FString &s);
|
||||
FString us2fs(const wchar_t *s);
|
||||
#define fas2fs(_x_) (_x_)
|
||||
#define fs2fas(_x_) (_x_)
|
||||
|
||||
#endif
|
||||
|
||||
#define FTEXT(quote) __FTEXT(quote)
|
||||
|
||||
#define FCHAR_PATH_SEPARATOR FTEXT(CHAR_PATH_SEPARATOR)
|
||||
#define FSTRING_PATH_SEPARATOR FTEXT(STRING_PATH_SEPARATOR)
|
||||
#define FCHAR_ANY_MASK FTEXT('*')
|
||||
#define FSTRING_ANY_MASK FTEXT("*")
|
||||
typedef const FChar *CFSTR;
|
||||
|
||||
typedef CObjectVector<FString> FStringVector;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,10 +26,13 @@ BSTR SysAllocStringByteLen(LPCSTR psz, UINT len)
|
||||
return 0;
|
||||
*(UINT *)p = len;
|
||||
BSTR bstr = (BSTR)((UINT *)p + 1);
|
||||
memmove(bstr, psz, len);
|
||||
Byte *pb = ((Byte *)bstr) + len;
|
||||
for (int i = 0; i < sizeof(OLECHAR) * 2; i++)
|
||||
pb[i] = 0;
|
||||
if (psz)
|
||||
{
|
||||
memmove(bstr, psz, len);
|
||||
Byte *pb = ((Byte *)bstr) + len;
|
||||
for (unsigned i = 0; i < sizeof(OLECHAR) * 2; i++)
|
||||
pb[i] = 0;
|
||||
}
|
||||
return bstr;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// MyWindows.h
|
||||
|
||||
#ifndef __MYWINDOWS_H
|
||||
#define __MYWINDOWS_H
|
||||
#ifndef __MY_WINDOWS_H
|
||||
#define __MY_WINDOWS_H
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -40,8 +40,8 @@ typedef UINT32 DWORD;
|
||||
typedef Int64 LONGLONG;
|
||||
typedef UInt64 ULONGLONG;
|
||||
|
||||
typedef struct LARGE_INTEGER { LONGLONG QuadPart; }LARGE_INTEGER;
|
||||
typedef struct _ULARGE_INTEGER { ULONGLONG QuadPart;} ULARGE_INTEGER;
|
||||
typedef struct _LARGE_INTEGER { LONGLONG QuadPart; } LARGE_INTEGER;
|
||||
typedef struct _ULARGE_INTEGER { ULONGLONG QuadPart; } ULARGE_INTEGER;
|
||||
|
||||
typedef const CHAR *LPCSTR;
|
||||
typedef CHAR TCHAR;
|
||||
@@ -57,7 +57,7 @@ typedef struct _FILETIME
|
||||
{
|
||||
DWORD dwLowDateTime;
|
||||
DWORD dwHighDateTime;
|
||||
}FILETIME;
|
||||
} FILETIME;
|
||||
|
||||
#define HRESULT LONG
|
||||
#define FAILED(Status) ((HRESULT)(Status)<0)
|
||||
@@ -179,6 +179,13 @@ typedef VARIANT VARIANTARG;
|
||||
MY_EXTERN_C HRESULT VariantClear(VARIANTARG *prop);
|
||||
MY_EXTERN_C HRESULT VariantCopy(VARIANTARG *dest, VARIANTARG *src);
|
||||
|
||||
typedef struct tagSTATPROPSTG
|
||||
{
|
||||
LPOLESTR lpwstrName;
|
||||
PROPID propid;
|
||||
VARTYPE vt;
|
||||
} STATPROPSTG;
|
||||
|
||||
#endif
|
||||
|
||||
MY_EXTERN_C BSTR SysAllocStringByteLen(LPCSTR psz, UINT len);
|
||||
|
||||
@@ -88,3 +88,10 @@ Int64 ConvertStringToInt64(const char *s, const char **end)
|
||||
return -(Int64)ConvertStringToUInt64(s + 1, end);
|
||||
return ConvertStringToUInt64(s, end);
|
||||
}
|
||||
|
||||
Int64 ConvertStringToInt64(const wchar_t *s, const wchar_t **end)
|
||||
{
|
||||
if (*s == L'-')
|
||||
return -(Int64)ConvertStringToUInt64(s + 1, end);
|
||||
return ConvertStringToUInt64(s, end);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
// Common/StringToInt.h
|
||||
|
||||
#ifndef __COMMON_STRINGTOINT_H
|
||||
#define __COMMON_STRINGTOINT_H
|
||||
#ifndef __COMMON_STRING_TO_INT_H
|
||||
#define __COMMON_STRING_TO_INT_H
|
||||
|
||||
#include <string.h>
|
||||
#include "Types.h"
|
||||
|
||||
UInt64 ConvertStringToUInt64(const char *s, const char **end);
|
||||
@@ -12,7 +11,6 @@ UInt64 ConvertHexStringToUInt64(const char *s, const char **end);
|
||||
UInt64 ConvertStringToUInt64(const wchar_t *s, const wchar_t **end);
|
||||
|
||||
Int64 ConvertStringToInt64(const char *s, const char **end);
|
||||
Int64 ConvertStringToInt64(const wchar_t *s, const wchar_t **end);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -342,9 +342,9 @@ void CCensorNode::AddItem2(bool include, const UString &path, bool recursive)
|
||||
bool forFile = true;
|
||||
bool forFolder = true;
|
||||
UString path2 = path;
|
||||
if (IsCharDirLimiter(path[path.Length() - 1]))
|
||||
if (IsCharDirLimiter(path.Back()))
|
||||
{
|
||||
path2.Delete(path.Length() - 1);
|
||||
path2.DeleteBack();
|
||||
forFile = false;
|
||||
}
|
||||
AddItem(include, path2, recursive, forFile, forFolder);
|
||||
|
||||
Reference in New Issue
Block a user