Стартовый пул

This commit is contained in:
2024-04-02 08:46:59 +03:00
parent fd57fffd3a
commit 3bb34d000b
5591 changed files with 3291734 additions and 0 deletions

View File

@@ -0,0 +1,130 @@
////////////////////////////////////////////////////////////////////////////////
//
// ****************************************************************************
// * Project : FWZip
// * Unit Name : ModifyMultiPartZip
// * Purpose : Демонстрация модификации многотомного архива
// * Author : Александр (Rouse_) Багель
// * Copyright : © Fangorn Wizards Lab 1998 - 2023.
/// * Version : 2.0.0
// * Home Page : http://rouse.drkb.ru
// * Home Blog : http://alexander-bagel.blogspot.ru
// ****************************************************************************
// * Stable Release : http://rouse.drkb.ru/components.php#fwzip
// * Latest Source : https://github.com/AlexanderBagel/FWZip
// ****************************************************************************
//
// Используемые источники:
// ftp://ftp.info-zip.org/pub/infozip/doc/appnote-iz-latest.zip
// https://zlib.net/zlib-1.2.13.tar.gz
// http://www.base2ti.com/
//
// Хоть модификация многотомных архивов идея достаточно странная сама по себе,
// но архитектура фреймворка легко позволяет это осуществить.
// При чем модификатор будет спокойно работать и с обычными архивами и с многотомными
// модифицируя оба типа архивов, а так-же легко может провести конвертацию
// без этапа перепаковки данных из многотомного архива в обычный и наоборот.
program ModifyMultiPartZip;
{$IFDEF FPC}
{$MODE Delphi}
{$H+}
{$ELSE}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
SysUtils,
Classes,
TypInfo,
FWZipZLib,
FWZipWriter,
FWZipStream,
FWZipModifier;
var
Writer: TFWZipWriter;
S: TStringStream;
MultiStreamRead, MultiStreamWrite: TFWFileMultiStream;
Modifier: TFWZipModifier;
I, Index1, Index2: Integer;
BuildZipResult: TBuildZipResult;
begin
SetCurrentDir(ExtractFilePath(ParamStr(0)));
try
// Модификация многотомного архиве ничем не отличается от модификации
// обычного архива, за исключением использования наследников
// TFWAbstractMultiStream для чтения и записи
// Например возьмем архив созданный в примере CreateMultyPartZip.dpr
// и удалим из него все *.pas файлы.
// А так-же добавим файлы из обычного не многотомного архива
MultiStreamRead := TFWFileMultiStream.CreateRead(
'..\..\DemoResults\MultyPartZip\MultyPartZip.zip');
try
Modifier := TFWZipModifier.Create;
try
// загружаем многотомный архив в модификатор
Index1 := Modifier.AddZipFile(MultiStreamRead);
// добавляем все элементы архива
Modifier.AddFromZip(Index1);
// удаляем все PAS файлы
for I := Modifier.Count - 1 downto 0 do
if AnsiLowerCase(ExtractFileExt(Modifier[I].FileName)) = '.pas' then
Modifier.DeleteItem(I);
// теперь создадим простой архив
Writer := TFWZipWriter.Create;
try
S := TStringStream.Create('Просто тестовые данные для демонстрации');
Writer.AddStream('test_stream.txt', S, soOwned);
Writer.BuildZip('..\..\DemoResults\MultyPartZip\stream.zip')
finally
Writer.Free;
end;
// загружаем обычный архив в модификатор
Index2 := Modifier.AddZipFile('..\..\DemoResults\MultyPartZip\stream.zip');
// добавляем единственный элемент простого архива
Modifier.AddFromZip(Index2, 'test_stream.txt');
// ... и сохранияем все в новый архив
// Причем!
// т.к. мы не указываем второй параметр, отвечающий за размер каждого тома
// то он берется по умолчанию и новый архив будет сформирован с томами
// другого размера, чем был в изначальном архиве.
// Все изменения произойдут на лету, вам не нужно их контролировать.
MultiStreamWrite := TFWFileMultiStream.CreateWrite(
'..\..\DemoResults\MultyPartZip\MultyPartZipWithoutPas.zip');
try
BuildZipResult := Modifier.BuildZip(MultiStreamWrite);
finally
MultiStreamWrite.Free;
end;
finally
Modifier.Free;
end;
finally
MultiStreamRead.Free;
end;
// ... выводим результат
Writeln(GetEnumName(TypeInfo(TBuildZipResult), Integer(BuildZipResult)));
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.

View File

@@ -0,0 +1,112 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{431C00A8-F08F-463E-8EBD-90AE046E4363}</ProjectGuid>
<MainSource>ModifyMultiPartZip.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<FrameworkType>None</FrameworkType>
<ProjectVersion>19.2</ProjectVersion>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win32)'!=''">
<Cfg_2_Win32>true</Cfg_2_Win32>
<CfgParent>Cfg_2</CfgParent>
<Cfg_2>true</Cfg_2>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_E>false</DCC_E>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_ImageBase>00400000</DCC_ImageBase>
<SanitizedProjectName>ModifyMultiPartZip</SanitizedProjectName>
<VerInfo_Locale>1049</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=</VerInfo_Keys>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<BT_BuildType>Debug</BT_BuildType>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_DebugInformation>0</DCC_DebugInformation>
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_UnitSearchPath>../../../;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Debug">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">ModifyMultiPartZip.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k270.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp270.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
</Project>

View File

@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<MainUnitHasUsesSectionForAllUnits Value="False"/>
<MainUnitHasCreateFormStatements Value="False"/>
<MainUnitHasTitleStatement Value="False"/>
<MainUnitHasScaledStatement Value="False"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="ModifyMultiPartZip"/>
<UseAppBundle Value="False"/>
<ResourceType Value="res"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="ModifyMultiPartZip.dpr"/>
<IsPartOfProject Value="True"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="..\..\..;$(ProjOutDir)"/>
<Libraries Value="..\..\..\fpc_lib"/>
<OtherUnitFiles Value="..\..\.."/>
<UnitOutputDirectory Value="."/>
</SearchPaths>
<Parsing>
<SyntaxOptions>
<SyntaxMode Value="Delphi"/>
</SyntaxOptions>
</Parsing>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf2Set"/>
</Debugging>
</Linking>
<Other>
<CustomOptions Value="-dBorland -dVer150 -dDelphi7 -dCompiler6_Up -dPUREPASCAL"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@@ -0,0 +1,24 @@
rd /S /Q "%cd%\backup\"
rd /S /Q "%cd%\ConverterBackup\"
rd /S /Q "%cd%\lib\"
rd /S /Q "%cd%\__history\"
rd /S /Q "%cd%\__recovery\"
del "%cd%\*.o"
del "%cd%\*.a"
del "%cd%\*.or"
del "%cd%\*.lps"
del "%cd%\*.obj"
del "%cd%\*.exe"
del "%cd%\*.ppu"
del "%cd%\*.dcu"
del "%cd%\*.log"
del "%cd%\*.compiled"
del "%cd%\*.cfg"
del "%cd%\*.dof"
del "%cd%\*.dproj.local"
del "%cd%\*.identcache"
del "%cd%\*.dsk"
del "%cd%\*.skincfg"
del "%cd%\*.bak"
del "%cd%\*.rsm"
del "%cd%\*.~*"