diff --git a/.gitignore b/.gitignore index 95e708a..93b6685 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,30 @@ ``` -# Build artifacts +# Compiled and build artifacts *.o *.obj -*.a -*.so -*.dll *.exe +*.dll +*.so +*.a *.out +build/ +dist/ +target/ # Dependencies -3rdparty/ +venv/ +.venv/ +__pycache__/ +.mypy_cache/ +.pytest_cache/ +.gradle/ +node_modules/ # Logs and temp files *.log *.tmp +*.swp +*.swo # Environment .env @@ -24,7 +35,12 @@ .vscode/ .idea/ -# OS specific +# Coverage +coverage/ +htmlcov/ +.coverage + +# System files .DS_Store Thumbs.db ``` \ No newline at end of file diff --git a/src/APIcfBase.h b/src/APIcfBase.h index a0df152..d3a63a8 100644 --- a/src/APIcfBase.h +++ b/src/APIcfBase.h @@ -8,7 +8,7 @@ #ifndef APIcfBaseH #define APIcfBaseH -#include +#include "vcl_utils.h" #include #include @@ -110,7 +110,7 @@ class v8file TCriticalSection *Lock; - TStream* data; + vcl_utils::TStream* data; v8catalog* parent; @@ -159,9 +159,9 @@ class v8file // перезапись целиком int Write(const void* Buffer, int Length); // дозапись/перезапись частично - int Write(TStream* Stream, int Start, int Length); + int Write(vcl_utils::TStream* Stream, int Start, int Length); // перезапись целиком - int Write(TStream* Stream); + int Write(vcl_utils::TStream* Stream); String GetFileName(); String GetFullName(); @@ -178,7 +178,7 @@ class v8file void Close(); // перезапись целиком и закрытие файла (для экономии памяти не используется data файла) - int WriteAndClose(TStream* Stream, int Length = -1); + int WriteAndClose(vcl_utils::TStream* Stream, int Length = -1); void GetTimeCreate(FILETIME* ft); void GetTimeModify(FILETIME* ft); @@ -186,8 +186,8 @@ class v8file void SetTimeModify(FILETIME* ft); void SaveToFile(const String& FileName); - void SaveToStream(TStream* stream); - //TStream* get_data(); + void SaveToStream(vcl_utils::TStream* stream); + //vcl_utils::TStream* get_data(); TV8FileStream* get_stream(bool own = false); @@ -204,8 +204,8 @@ class v8catalog v8file* file; // файл, которым является каталог. Для корневого каталога NULL - TStream* data; // поток каталога. Если file не NULL (каталог не корневой), совпадает с file->data - TStream* cfu; // поток файла cfu. Существует только при is_cfu == true + vcl_utils::TStream* data; // поток каталога. Если file не NULL (каталог не корневой), совпадает с file->data + vcl_utils::TStream* cfu; // поток файла cfu. Существует только при is_cfu == true void initialize(int Offset = 0); @@ -236,12 +236,12 @@ class v8catalog void free_block(int start); // возвращает адрес начала блока - int write_block(TStream* block, int start, bool use_page_size, int len = -1); + int write_block(vcl_utils::TStream* block, int start, bool use_page_size, int len = -1); // возвращает адрес начала блока - int write_datablock(TStream* block, int start, bool _zipped = false, int len = -1); + int write_datablock(vcl_utils::TStream* block, int start, bool _zipped = false, int len = -1); - TStream* read_datablock(int start, int offset = 0); + vcl_utils::TStream* read_datablock(int start, int offset = 0); int get_nextblock(int start); @@ -254,7 +254,7 @@ class v8catalog v8catalog(v8file* f); // создать каталог из файла v8catalog(String name); // создать каталог из физического файла (cf, epf, erf, hbk, cfu) v8catalog(String name, bool _zipped); // создать каталог из физического файла (cf, epf, erf, hbk, cfu) - v8catalog(TStream* stream, bool _zipped, bool leave_stream = false); // создать каталог из потока + v8catalog(vcl_utils::TStream* stream, bool _zipped, bool leave_stream = false); // создать каталог из потока ~v8catalog(); @@ -280,7 +280,7 @@ class v8catalog }; //=========================================================================== -class TV8FileStream : public TStream +class TV8FileStream : public vcl_utils::TStream { protected: v8file* file; @@ -296,8 +296,8 @@ class TV8FileStream : public TStream virtual int Write(const void *Buffer, int Count); virtual int Write(const ByteArr Buffer, int Offset, int Count); - virtual int Seek(int Offset, System::Word Origin); - virtual __int64 Seek(const __int64 Offset, TSeekOrigin Origin); + virtual int Seek(int Offset, int Origin); // Заменено System::Word на int + virtual __int64 Seek(const __int64 Offset, int Origin); // Заменено TSeekOrigin на int }; #endif diff --git a/src/Base64.h b/src/Base64.h index 8bbcc74..dc38f3c 100644 --- a/src/Base64.h +++ b/src/Base64.h @@ -3,7 +3,7 @@ #ifndef Base64H #define Base64H -#include +#include "vcl_utils.h" //--------------------------------------------------------------------------- void base64_encode(TStream* infile, TStream* outfile, int linesize); diff --git a/src/Common.cpp b/src/Common.cpp index e4337b7..5fb769b 100644 --- a/src/Common.cpp +++ b/src/Common.cpp @@ -422,7 +422,7 @@ String tohex64(__int64 n) } //--------------------------------------------------------------------------- -String hexstring(TStream* str) +String hexstring(vcl_utils::TStream* str) { int i; String s = L""; diff --git a/src/Common.h b/src/Common.h index f9a8abd..9f4b585 100644 --- a/src/Common.h +++ b/src/Common.h @@ -6,7 +6,7 @@ //#include #include #include "APIcfBase.h" -#include +#include "vcl_utils.h" //--------------------------------------------------------------------------- void time1CD_to_FileTime(FILETIME* ft, unsigned char* time1CD); @@ -25,7 +25,7 @@ String date_to_string(const unsigned char* bytedate); String tohex(int n); String tohex64(__int64 n); String hexstring(char* buf, int n); -String hexstring(TStream* str); +String hexstring(vcl_utils::TStream* str); //--------------------------------------------------------------------------- String GetNameFromTreePath(v8catalog *cf, String &guid_md, const std::vector& path); diff --git a/src/ConfigStorage.h b/src/ConfigStorage.h index aa210ef..7094374 100644 --- a/src/ConfigStorage.h +++ b/src/ConfigStorage.h @@ -3,7 +3,7 @@ #ifndef ConfigStorageH #define ConfigStorageH -#include +#include "vcl_utils.h" #include #include #include diff --git a/src/MainUnit.cpp b/src/MainUnit.cpp index c62df2c..0108e71 100644 --- a/src/MainUnit.cpp +++ b/src/MainUnit.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include "vcl_utils.h" #include "V8File.h" #include "ApicfBase.h" diff --git a/src/MainUnit.h b/src/MainUnit.h index 320d40f..52e99ef 100644 --- a/src/MainUnit.h +++ b/src/MainUnit.h @@ -3,7 +3,7 @@ #ifndef MainUnitH #define MainUnitH //--------------------------------------------------------------------------- -#include +#include "vcl_utils.h" #include #include #include diff --git a/src/MessageRegistration.h b/src/MessageRegistration.h index 1ca753e..e17e85d 100644 --- a/src/MessageRegistration.h +++ b/src/MessageRegistration.h @@ -3,7 +3,7 @@ #ifndef MessageRegistrationH #define MessageRegistrationH -#include +#include "vcl_utils.h" //#include #pragma hdrstop diff --git a/src/MetaObject.h b/src/MetaObject.h index 4bb9a32..563132d 100644 --- a/src/MetaObject.h +++ b/src/MetaObject.h @@ -16,8 +16,7 @@ // Для совместимости с C++ Builder VCL #ifdef __BORLANDC__ -#include -#include +#include "vcl_utils.h" #endif // Forward declarations diff --git a/src/ModuleTextStorage.h b/src/ModuleTextStorage.h index beecc9b..c5e15a1 100644 --- a/src/ModuleTextStorage.h +++ b/src/ModuleTextStorage.h @@ -3,8 +3,8 @@ #ifndef ModuleTextStorageH #define ModuleTextStorageH -#include -#include +#include "vcl_utils.h" +#include "vcl_utils.h" #include "APIcfBase.h" #include "Parse_tree.h" diff --git a/src/Property.h b/src/Property.h index 0f5ee3f..5db2da1 100644 --- a/src/Property.h +++ b/src/Property.h @@ -16,8 +16,7 @@ // Для совместимости с C++ Builder VCL #ifdef __BORLANDC__ -#include -#include +#include "vcl_utils.h" #include #endif diff --git a/src/SynHighlighter1C.h b/src/SynHighlighter1C.h index 5551894..07afbf2 100644 --- a/src/SynHighlighter1C.h +++ b/src/SynHighlighter1C.h @@ -4,8 +4,7 @@ #define SynHighlighter1CH //--------------------------------------------------------------------------- -#include -#include +#include "vcl_utils.h" #include #include "SynEditHighlighter.hpp" diff --git a/src/TempStream.h b/src/TempStream.h index 5285f49..b6fc16f 100644 --- a/src/TempStream.h +++ b/src/TempStream.h @@ -3,7 +3,7 @@ #ifndef TempStreamH #define TempStreamH -#include +#include "vcl_utils.h" class TTempStreamStaticInit { @@ -14,13 +14,13 @@ class TTempStreamStaticInit //--------------------------------------------------------------------------- -class TTempStream : public THandleStream +class TTempStream : public vcl_utils::TStream { public: - static String tempcat; - static String tempname; + static std::wstring tempcat; + static std::wstring tempname; static long tempno; - static String gettempname(); + static std::wstring gettempname(); TTempStream(); virtual ~TTempStream(); diff --git a/src/UZLib.h b/src/UZLib.h index cfab5fe..6f5bb9f 100644 --- a/src/UZLib.h +++ b/src/UZLib.h @@ -4,7 +4,7 @@ #define UZLibH -#include +#include "vcl_utils.h" #include "zlib.h" //--------------------------------------------------------------------------- @@ -116,8 +116,8 @@ class ZInflateStream : ZStreamBase }; -void ZInflateStream(TStream* src, TStream* dst); -void ZDeflateStream(TStream* src, TStream* dst); +void ZInflateStream(vcl_utils::TStream* src, vcl_utils::TStream* dst); +void ZDeflateStream(vcl_utils::TStream* src, vcl_utils::TStream* dst); int inf(FILE *source, FILE *dest); int def(FILE *source, FILE *dest, int level); diff --git a/src/v8reader.cpp b/src/v8reader.cpp index 5c8c881..8eb6376 100644 --- a/src/v8reader.cpp +++ b/src/v8reader.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include "vcl_utils.h" //--------------------------------------------------------------------------- USEFORM("MainUnit.cpp", MainForm); //---------------------------------------------------------------------------