mirror of
https://github.com/Xevion/easy7zip.git
synced 2026-01-31 04:24:11 -06:00
9.18
This commit is contained in:
committed by
Kornel Lesiński
parent
2eb60a0598
commit
c65230d858
@@ -1,7 +1,7 @@
|
||||
// Common/DynamicBuffer.h
|
||||
|
||||
#ifndef __COMMON_DYNAMICBUFFER_H
|
||||
#define __COMMON_DYNAMICBUFFER_H
|
||||
#ifndef __COMMON_DYNAMIC_BUFFER_H
|
||||
#define __COMMON_DYNAMIC_BUFFER_H
|
||||
|
||||
#include "Buffer.h"
|
||||
|
||||
@@ -17,7 +17,10 @@ template <class T> class CDynamicBuffer: public CBuffer<T>
|
||||
else
|
||||
delta = 4;
|
||||
delta = MyMax(delta, size);
|
||||
SetCapacity(this->_capacity + delta);
|
||||
size_t newCap = this->_capacity + delta;
|
||||
if (newCap < delta)
|
||||
newCap = this->_capacity + size;
|
||||
SetCapacity(newCap);
|
||||
}
|
||||
public:
|
||||
CDynamicBuffer(): CBuffer<T>() {};
|
||||
|
||||
@@ -64,3 +64,14 @@ void ConvertInt64ToString(Int64 value, wchar_t *s)
|
||||
}
|
||||
ConvertUInt64ToString(value, s);
|
||||
}
|
||||
|
||||
void ConvertUInt32ToHexWithZeros(UInt32 value, char *s)
|
||||
{
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
int t = value & 0xF;
|
||||
value >>= 4;
|
||||
s[7 - i] = (char)((t < 10) ? ('0' + t) : ('A' + (t - 10)));
|
||||
}
|
||||
s[8] = '\0';
|
||||
}
|
||||
|
||||
@@ -14,4 +14,6 @@ void ConvertInt64ToString(Int64 value, wchar_t *s);
|
||||
void ConvertUInt32ToString(UInt32 value, char *s);
|
||||
void ConvertUInt32ToString(UInt32 value, wchar_t *s);
|
||||
|
||||
void ConvertUInt32ToHexWithZeros(UInt32 value, char *s);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
|
||||
#include "MyVector.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "MyWindows.h"
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
inline int MyStringLen(const T *s)
|
||||
{
|
||||
|
||||
@@ -78,6 +78,22 @@ public:
|
||||
operator[](j) = temp;
|
||||
}
|
||||
|
||||
int FindInSorted(const T& item, int left, int right) const
|
||||
{
|
||||
while (left != right)
|
||||
{
|
||||
int mid = (left + right) / 2;
|
||||
const T& midValue = (*this)[mid];
|
||||
if (item == midValue)
|
||||
return mid;
|
||||
if (item < midValue)
|
||||
right = mid;
|
||||
else
|
||||
left = mid + 1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int FindInSorted(const T& item) const
|
||||
{
|
||||
int left = 0, right = Size();
|
||||
|
||||
@@ -7,18 +7,8 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define CHAR_PATH_SEPARATOR '\\'
|
||||
#define WCHAR_PATH_SEPARATOR L'\\'
|
||||
#define STRING_PATH_SEPARATOR "\\"
|
||||
#define WSTRING_PATH_SEPARATOR L"\\"
|
||||
|
||||
#else
|
||||
|
||||
#define CHAR_PATH_SEPARATOR '/'
|
||||
#define WCHAR_PATH_SEPARATOR L'/'
|
||||
#define STRING_PATH_SEPARATOR "/"
|
||||
#define WSTRING_PATH_SEPARATOR L"/"
|
||||
|
||||
#include <stddef.h> // for wchar_t
|
||||
#include <string.h>
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "../../C/Types.h"
|
||||
|
||||
#include "Wildcard.h"
|
||||
|
||||
bool g_CaseSensitive =
|
||||
|
||||
Reference in New Issue
Block a user