diff options
Diffstat (limited to 'CPP/Common')
-rwxr-xr-x | CPP/Common/AlignedBuffer.cpp | 22 | ||||
-rwxr-xr-x | CPP/Common/AlignedBuffer.h | 18 | ||||
-rwxr-xr-x | CPP/Common/CommandLineParser.h | 2 | ||||
-rwxr-xr-x | CPP/Common/Exception.h | 13 | ||||
-rwxr-xr-x | CPP/Common/Lang.cpp | 4 | ||||
-rwxr-xr-x | CPP/Common/Lang.h | 6 | ||||
-rwxr-xr-x | CPP/Common/ListFileUtils.h | 7 | ||||
-rwxr-xr-x | CPP/Common/MyException.h | 14 | ||||
-rwxr-xr-x | CPP/Common/MyString.cpp (renamed from CPP/Common/String.cpp) | 4 | ||||
-rwxr-xr-x | CPP/Common/MyString.h (renamed from CPP/Common/String.h) | 9 | ||||
-rwxr-xr-x | CPP/Common/MyVector.cpp (renamed from CPP/Common/Vector.cpp) | 4 | ||||
-rwxr-xr-x | CPP/Common/MyVector.h (renamed from CPP/Common/Vector.h) | 0 | ||||
-rwxr-xr-x | CPP/Common/Random.cpp | 2 | ||||
-rwxr-xr-x | CPP/Common/StdInStream.h | 2 | ||||
-rwxr-xr-x | CPP/Common/StdOutStream.cpp | 4 | ||||
-rwxr-xr-x | CPP/Common/StringConvert.h | 2 | ||||
-rwxr-xr-x | CPP/Common/TextConfig.cpp | 4 | ||||
-rwxr-xr-x | CPP/Common/TextConfig.h | 4 | ||||
-rwxr-xr-x | CPP/Common/UTFConvert.h | 2 | ||||
-rwxr-xr-x | CPP/Common/Wildcard.h | 2 |
20 files changed, 46 insertions, 79 deletions
diff --git a/CPP/Common/AlignedBuffer.cpp b/CPP/Common/AlignedBuffer.cpp deleted file mode 100755 index ec472ced..00000000 --- a/CPP/Common/AlignedBuffer.cpp +++ /dev/null @@ -1,22 +0,0 @@ -// AlignedBuffer.cpp - -#include "StdAfx.h" - -#include "AlignedBuffer.h" - -void *CAlignedBuffer::Allocate(size_t size, size_t mask) -{ - Free(); - m_Buffer = new unsigned char[size + mask]; - unsigned char *p = m_Buffer; - while(((size_t)p & mask) != 0) - p++; - return (void *)p; -} - -void CAlignedBuffer::Free() -{ - if (m_Buffer != 0) - delete []m_Buffer; - m_Buffer = 0; -} diff --git a/CPP/Common/AlignedBuffer.h b/CPP/Common/AlignedBuffer.h deleted file mode 100755 index d040463e..00000000 --- a/CPP/Common/AlignedBuffer.h +++ /dev/null @@ -1,18 +0,0 @@ -// Common/AlignedBuffer.h - -#ifndef __COMMON_ALIGNEDBUFFER_H -#define __COMMON_ALIGNEDBUFFER_H - -#include <stddef.h> - -class CAlignedBuffer -{ - unsigned char *m_Buffer; -public: - CAlignedBuffer(): m_Buffer(0) {}; - ~CAlignedBuffer() { Free(); } - void *Allocate(size_t size, size_t mask); - void Free(); -}; - -#endif diff --git a/CPP/Common/CommandLineParser.h b/CPP/Common/CommandLineParser.h index af698db8..a97f58a5 100755 --- a/CPP/Common/CommandLineParser.h +++ b/CPP/Common/CommandLineParser.h @@ -3,7 +3,7 @@ #ifndef __COMMON_COMMANDLINEPARSER_H #define __COMMON_COMMANDLINEPARSER_H -#include "Common/String.h" +#include "MyString.h" namespace NCommandLineParser { diff --git a/CPP/Common/Exception.h b/CPP/Common/Exception.h deleted file mode 100755 index d7f86a90..00000000 --- a/CPP/Common/Exception.h +++ /dev/null @@ -1,13 +0,0 @@ -// Common/Exception.h - -#ifndef __COMMON_EXCEPTION_H -#define __COMMON_EXCEPTION_H - -struct CSystemException -{ - DWORD ErrorCode; - CSystemException(): ErrorCode(::GetLastError()) {} - CSystemException(DWORD errorCode): ErrorCode(errorCode) {} -}; - -#endif diff --git a/CPP/Common/Lang.cpp b/CPP/Common/Lang.cpp index f1861d6e..803209cf 100755 --- a/CPP/Common/Lang.cpp +++ b/CPP/Common/Lang.cpp @@ -2,8 +2,8 @@ #include "StdAfx.h" -#include "Common/Lang.h" -#include "Common/TextConfig.h" +#include "Lang.h" +#include "TextConfig.h" #include "StdInStream.h" #include "UTFConvert.h" diff --git a/CPP/Common/Lang.h b/CPP/Common/Lang.h index 2b4615d0..acbf8a6b 100755 --- a/CPP/Common/Lang.h +++ b/CPP/Common/Lang.h @@ -3,9 +3,9 @@ #ifndef __COMMON_LANG_H #define __COMMON_LANG_H -#include "Common/Vector.h" -#include "Common/String.h" -#include "Common/Types.h" +#include "MyVector.h" +#include "MyString.h" +#include "Types.h" struct CLangPair { diff --git a/CPP/Common/ListFileUtils.h b/CPP/Common/ListFileUtils.h index 93bb4507..182d32fa 100755 --- a/CPP/Common/ListFileUtils.h +++ b/CPP/Common/ListFileUtils.h @@ -3,10 +3,9 @@ #ifndef __COMMON_LISTFILEUTILS_H #define __COMMON_LISTFILEUTILS_H -#include "Common/String.h" -#include "Common/Types.h" +#include "MyString.h" +#include "Types.h" -bool ReadNamesFromListFile(LPCTSTR fileName, UStringVector &strings, - UINT codePage = CP_OEMCP); +bool ReadNamesFromListFile(LPCTSTR fileName, UStringVector &strings, UINT codePage = CP_OEMCP); #endif diff --git a/CPP/Common/MyException.h b/CPP/Common/MyException.h new file mode 100755 index 00000000..f0ad1115 --- /dev/null +++ b/CPP/Common/MyException.h @@ -0,0 +1,14 @@ +// Common/Exception.h + +#ifndef __COMMON_EXCEPTION_H +#define __COMMON_EXCEPTION_H + +#include "MyWindows.h" + +struct CSystemException +{ + HRESULT ErrorCode; + CSystemException(HRESULT errorCode): ErrorCode(errorCode) {} +}; + +#endif diff --git a/CPP/Common/String.cpp b/CPP/Common/MyString.cpp index 34da1487..affdcb0b 100755 --- a/CPP/Common/String.cpp +++ b/CPP/Common/MyString.cpp @@ -1,4 +1,4 @@ -// Common/String.cpp +// Common/MyString.cpp #include "StdAfx.h" @@ -8,7 +8,7 @@ #include <ctype.h> #endif -#include "String.h" +#include "MyString.h" #ifdef _WIN32 diff --git a/CPP/Common/String.h b/CPP/Common/MyString.h index 6ec5b8f3..c46ca545 100755 --- a/CPP/Common/String.h +++ b/CPP/Common/MyString.h @@ -6,7 +6,7 @@ #include <string.h> // #include <wchar.h> -#include "Vector.h" +#include "MyVector.h" #ifdef _WIN32 #include "MyWindows.h" @@ -358,8 +358,15 @@ public: int Compare(const CStringBase& s) const { return MyStringCompare(_chars, s._chars); } + int Compare(const T *s) const + { return MyStringCompare(_chars, s); } + int CompareNoCase(const CStringBase& s) const { return MyStringCompareNoCase(_chars, s._chars); } + + int CompareNoCase(const T *s) const + { return MyStringCompareNoCase(_chars, s); } + /* int Collate(const CStringBase& s) const { return MyStringCollate(_chars, s._chars); } diff --git a/CPP/Common/Vector.cpp b/CPP/Common/MyVector.cpp index b3dd70a5..86e56da0 100755 --- a/CPP/Common/Vector.cpp +++ b/CPP/Common/MyVector.cpp @@ -1,10 +1,10 @@ -// Common/Vector.cpp +// Common/MyVector.cpp #include "StdAfx.h" #include <string.h> -#include "Vector.h" +#include "MyVector.h" CBaseRecordVector::~CBaseRecordVector() { Free(); } diff --git a/CPP/Common/Vector.h b/CPP/Common/MyVector.h index 1bb67a1d..1bb67a1d 100755 --- a/CPP/Common/Vector.h +++ b/CPP/Common/MyVector.h diff --git a/CPP/Common/Random.cpp b/CPP/Common/Random.cpp index f4a629c2..9519987e 100755 --- a/CPP/Common/Random.cpp +++ b/CPP/Common/Random.cpp @@ -5,7 +5,7 @@ #include <time.h> #include <stdlib.h> -#include "Common/Random.h" +#include "Random.h" void CRandom::Init(unsigned int seed) { srand(seed); } diff --git a/CPP/Common/StdInStream.h b/CPP/Common/StdInStream.h index c1a0a222..e0fb3dfa 100755 --- a/CPP/Common/StdInStream.h +++ b/CPP/Common/StdInStream.h @@ -5,7 +5,7 @@ #include <stdio.h> -#include "Common/String.h" +#include "MyString.h" #include "Types.h" class CStdInStream diff --git a/CPP/Common/StdOutStream.cpp b/CPP/Common/StdOutStream.cpp index 5f1ef0fc..5498c0cc 100755 --- a/CPP/Common/StdOutStream.cpp +++ b/CPP/Common/StdOutStream.cpp @@ -5,8 +5,8 @@ #include <tchar.h> #include "StdOutStream.h" -#include "Common/IntToString.h" -#include "Common/StringConvert.h" +#include "IntToString.h" +#include "StringConvert.h" #ifdef _MSC_VER // "was declared deprecated" disabling diff --git a/CPP/Common/StringConvert.h b/CPP/Common/StringConvert.h index 84eaed9a..32d8a3a1 100755 --- a/CPP/Common/StringConvert.h +++ b/CPP/Common/StringConvert.h @@ -4,7 +4,7 @@ #define __COMMON_STRINGCONVERT_H #include "MyWindows.h" -#include "String.h" +#include "MyString.h" #include "Types.h" UString MultiByteToUnicodeString(const AString &srcString, UINT codePage = CP_ACP); diff --git a/CPP/Common/TextConfig.cpp b/CPP/Common/TextConfig.cpp index 4fce320a..34fedeb8 100755 --- a/CPP/Common/TextConfig.cpp +++ b/CPP/Common/TextConfig.cpp @@ -2,10 +2,10 @@ #include "StdAfx.h" -#include "Common/TextConfig.h" +#include "TextConfig.h" #include "Defs.h" -#include "Common/UTFConvert.h" +#include "UTFConvert.h" static bool IsDelimitChar(char c) { diff --git a/CPP/Common/TextConfig.h b/CPP/Common/TextConfig.h index 1552df65..a25142a7 100755 --- a/CPP/Common/TextConfig.h +++ b/CPP/Common/TextConfig.h @@ -3,8 +3,8 @@ #ifndef __COMMON_TEXTCONFIG_H #define __COMMON_TEXTCONFIG_H -#include "Common/Vector.h" -#include "Common/String.h" +#include "MyVector.h" +#include "MyString.h" struct CTextConfigPair { diff --git a/CPP/Common/UTFConvert.h b/CPP/Common/UTFConvert.h index 47434111..2a14600d 100755 --- a/CPP/Common/UTFConvert.h +++ b/CPP/Common/UTFConvert.h @@ -3,7 +3,7 @@ #ifndef __COMMON_UTFCONVERT_H #define __COMMON_UTFCONVERT_H -#include "Common/String.h" +#include "MyString.h" bool ConvertUTF8ToUnicode(const AString &utfString, UString &resultString); bool ConvertUnicodeToUTF8(const UString &unicodeString, AString &resultString); diff --git a/CPP/Common/Wildcard.h b/CPP/Common/Wildcard.h index 82d2bbd2..55c9744e 100755 --- a/CPP/Common/Wildcard.h +++ b/CPP/Common/Wildcard.h @@ -3,7 +3,7 @@ #ifndef __COMMON_WILDCARD_H #define __COMMON_WILDCARD_H -#include "Common/String.h" +#include "MyString.h" void SplitPathToParts(const UString &path, UStringVector &pathParts); void SplitPathToParts(const UString &path, UString &dirPrefix, UString &name); |