AutoPtr.h |
|
654 |
C_FileIO.cpp |
|
1678 |
C_FileIO.h |
|
1008 |
CommandLineParser.cpp |
|
4104 |
CommandLineParser.h |
|
1290 |
Common.h |
This file is included to all cpp files in 7-Zip.
Each folder contains StdAfx.h file that includes "Common.h".
So 7-Zip includes "Common.h" in both modes:
with precompiled StdAfx.h
and
without precompiled StdAfx.h
If you use 7-Zip code, you must include "Common.h" before other h files of 7-zip.
If you don't need some things that are used in 7-Zip,
you can change this h file or h files included in this file.
|
1379 |
ComTry.h |
#define COM_TRY_END } \
catch(const CNewException &) { return E_OUTOFMEMORY; } \
catch(...) { return HRESULT_FROM_WIN32(ERROR_NOACCESS); } \
|
498 |
CRC.cpp |
|
156 |
CrcReg.cpp |
|
2209 |
Defs.h |
|
429 |
DynamicBuffer.h |
|
1428 |
IntToString.cpp |
void ConvertUInt32ToHex8Digits(UInt32 val, wchar_t *s)
{
s[8] = 0;
for (int i = 7; i >= 0; i--)
{
unsigned t = val & 0xF;
val >>= 4;
s[i] = (wchar_t)(((t < 10) ? ('0' + t) : ('A' + (t - 10))));
}
}
|
3736 |
IntToString.h |
|
1020 |
Lang.h |
|
433 |
ListFileUtils.cpp |
|
2690 |
ListFileUtils.h |
|
315 |
MyBuffer.h |
7-Zip now uses CBuffer only as CByteBuffer.
So there is no need to use MY_ARRAY_NEW macro in CBuffer code. |
5371 |
MyBuffer2.h |
|
933 |
MyCom.h |
HRESULT CoCreateInstance(LPCOLESTR szProgID, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL)
{
CLSID clsid;
HRESULT hr = CLSIDFromProgID(szProgID, &clsid);
ATLASSERT(_p == NULL);
if (SUCCEEDED(hr))
hr = ::CoCreateInstance(clsid, pUnkOuter, dwClsContext, __uuidof(T), (void**)&_p);
return hr;
}
|
7450 |
MyException.h |
|
241 |
MyGuidDef.h |
|
1106 |
MyInitGuid.h |
This file must be included only to one C++ file in project before
declarations of COM interfaces with DEFINE_GUID macro.
Each GUID must be initialized exactly once in project.
There are two different versions of the DEFINE_GUID macro in guiddef.h (MyGuidDef.h):
- if INITGUID is not defined: DEFINE_GUID declares an external reference to the symbol name.
- if INITGUID is defined: DEFINE_GUID initializes the symbol name to the value of the GUID.
Also we need IID_IUnknown that is initialized in some file for linking:
MSVC: by default the linker uses some lib file that contains IID_IUnknown
MinGW: add -luuid switch for linker
WinCE: we define IID_IUnknown in this file
Other: we define IID_IUnknown in this file
|
1253 |
MyLinux.h |
|
1308 |
MyString.cpp |
inline const char* MyStringGetNextCharPointer(const char *p) throw()
{
#if defined(_WIN32) && !defined(UNDER_CE)
return CharNextA(p);
#else
return p + 1;
#endif
}
|
33232 |
MyString.h |
native support for wchar_t:
_MSC_VER == 1600 : /Zc:wchar_t is not supported
_MSC_VER == 1310 (VS2003)
? _MSC_VER == 1400 (VS2005) : wchar_t <- unsigned short
/Zc:wchar_t : wchar_t <- __wchar_t, _WCHAR_T_DEFINED and _NATIVE_WCHAR_T_DEFINED
_MSC_VER > 1400 (VS2008+)
/Zc:wchar_t[-]
/Zc:wchar_t is on by default
|
26238 |
MyTypes.h |
|
475 |
MyUnknown.h |
#ifdef _WIN32
#include <basetyps.h>
#include <unknwn.h>
#else
#include "MyWindows.h"
#endif
|
212 |
MyVector.cpp |
|
47 |
MyVector.h |
void Delete(unsigned index, unsigned num)
{
if (num > 0)
{
MoveItems(index, index + num);
_size -= num;
}
}
|
13777 |
MyWindows.cpp |
Win32 uses DWORD (32-bit) type to store size of string before (OLECHAR *) string.
We must select CBstrSizeType for another systems (not Win32):
if (CBstrSizeType is UINT32),
then we support only strings smaller than 4 GB.
Win32 version always has that limitation.
if (CBstrSizeType is UINT),
(UINT can be 16/32/64-bit)
We can support strings larger than 4 GB (if UINT is 64-bit),
but sizeof(UINT) can be different in parts compiled by
different compilers/settings,
and we can't send such BSTR strings between such parts.
|
3688 |
MyWindows.h |
|
4914 |
NewHandler.cpp |
void * my_new(size_t size)
{
// void *p = ::HeapAlloc(::GetProcessHeap(), 0, size);
void *p = ::malloc(size);
if (p == 0)
throw CNewException();
return p;
}
void my_delete(void *p) throw()
{
// if (p == 0) return; ::HeapFree(::GetProcessHeap(), 0, p);
::free(p);
}
void * my_Realloc(void *p, size_t newSize, size_t oldSize)
{
void *newBuf = my_new(newSize);
if (oldSize != 0)
memcpy(newBuf, p, oldSize);
my_delete(p);
return newBuf;
}
|
2702 |
NewHandler.h |
NewHandler.h and NewHandler.cpp allows to solve problem with compilers that
don't throw exception in operator new().
This file must be included before any code that uses operators new() or delete()
and you must compile and link "NewHandler.cpp", if you use some old MSVC compiler.
The operator new() in some MSVC versions doesn't throw exception std::bad_alloc.
MSVC 6.0 (_MSC_VER == 1200) doesn't throw exception.
The code produced by some another MSVC compilers also can be linked
to library that doesn't throw exception.
We suppose that code compiled with VS2015+ (_MSC_VER >= 1900) throws exception std::bad_alloc.
For older _MSC_VER versions we redefine operator new() and operator delete().
Our version of operator new() throws CNewException() exception on failure.
It's still allowed to use redefined version of operator new() from "NewHandler.cpp"
with any compiler. 7-Zip's code can work with std::bad_alloc and CNewException() exceptions.
But if you use some additional code (outside of 7-Zip's code), you must check
that redefined version of operator new() is not problem for your code.
|
2244 |
Sha256Reg.cpp |
|
769 |
StdAfx.h |
|
88 |
StdInStream.cpp |
bool CStdInStream::ReadToString(AString &resultString)
{
resultString.Empty();
for (;;)
{
int intChar = GetChar();
if (intChar == EOF)
return !Error();
char c = (char)intChar;
if (c == 0)
return false;
resultString += c;
}
}
|
1811 |
StdInStream.h |
|
888 |
StdOutStream.cpp |
|
3438 |
StdOutStream.h |
|
1903 |
StringConvert.cpp |
MultiByteToWideChar(CodePage, DWORD dwFlags,
LPCSTR lpMultiByteStr, int cbMultiByte,
LPWSTR lpWideCharStr, int cchWideChar)
if (cbMultiByte == 0)
return: 0. ERR: ERROR_INVALID_PARAMETER
if (cchWideChar == 0)
return: the required buffer size in characters.
if (supplied buffer size was not large enough)
return: 0. ERR: ERROR_INSUFFICIENT_BUFFER
The number of filled characters in lpWideCharStr can be smaller than cchWideChar (if last character is complex)
If there are illegal characters:
if MB_ERR_INVALID_CHARS is set in dwFlags:
- the function stops conversion on illegal character.
- Return: 0. ERR: ERROR_NO_UNICODE_TRANSLATION.
if MB_ERR_INVALID_CHARS is NOT set in dwFlags:
before Vista: illegal character is dropped (skipped). WinXP-64: GetLastError() returns 0.
in Vista+: illegal character is not dropped (MSDN). Undocumented: illegal
character is converted to U+FFFD, which is REPLACEMENT CHARACTER.
|
7776 |
StringConvert.h |
inline const char* GetOemString(const char* oem)
{ return oem; }
inline const AString& GetOemString(const AString &oem)
{ return oem; }
|
3917 |
StringToInt.cpp |
|
3397 |
StringToInt.h |
|
813 |
TextConfig.cpp |
|
2718 |
TextConfig.h |
|
461 |
UTFConvert.cpp |
_UTF8_START(n) - is a base value for start byte (head), if there are (n) additional bytes after start byte
n : _UTF8_START(n) : Bits of code point
0 : 0x80 : : unused
1 : 0xC0 : 11 :
2 : 0xE0 : 16 : Basic Multilingual Plane
3 : 0xF0 : 21 : Unicode space
3 : 0xF8 : 26 :
5 : 0xFC : 31 : UCS-4
6 : 0xFE : 36 : We can use it, if we want to encode any 32-bit value
7 : 0xFF :
|
6301 |
UTFConvert.h |
|
354 |
Wildcard.cpp |
UString ExtractDirPrefixFromPath(const UString &path)
{
return path.Left(path.ReverseFind_PathSepar() + 1));
}
|
16062 |
Wildcard.h |
|
4362 |
XzCrc64Init.cpp |
|
162 |
XzCrc64Reg.cpp |
|
815 |