From: <tw...@us...> - 2021-08-14 16:07:14
|
Revision: 3580 http://sourceforge.net/p/gexperts/code/3580 Author: twm Date: 2021-08-14 16:07:11 +0000 (Sat, 14 Aug 2021) Log Message: ----------- updated to latest version from OSDN Modified Paths: -------------- trunk/ExternalSource/dzlib/dzlib.inc trunk/ExternalSource/dzlib/u_dzClassUtils.pas trunk/ExternalSource/dzlib/u_dzTranslator.pas trunk/ExternalSource/dzlib/u_dzTypes.pas Modified: trunk/ExternalSource/dzlib/dzlib.inc =================================================================== --- trunk/ExternalSource/dzlib/dzlib.inc 2021-08-14 13:25:21 UTC (rev 3579) +++ trunk/ExternalSource/dzlib/dzlib.inc 2021-08-14 16:07:11 UTC (rev 3580) @@ -99,6 +99,12 @@ {$DEFINE HAS_INTTOHEX_FUNCTION_UINT64} {$ENDIF} +{$IFDEF DELPHI2009_UP} + {.I know that it exists in $IFDEF GX_DELPHI_TOKYO_UP} + {$DEFINE CUSTOMINIFILE_HAS_READSUBSECTIONS} +{$ENDIF} + + {$IFOPT T+} {$DEFINE TYPEDADDRESS_IS_ON} {$ENDIF} Modified: trunk/ExternalSource/dzlib/u_dzClassUtils.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzClassUtils.pas 2021-08-14 13:25:21 UTC (rev 3579) +++ trunk/ExternalSource/dzlib/u_dzClassUtils.pas 2021-08-14 16:07:11 UTC (rev 3580) @@ -64,7 +64,6 @@ function TStringList_CreateFrom(const _sa: array of string; _SortHandling: TStringListSortHandling = sshNoSorting): TStringList; overload; - ///<summary> /// Creates a TStringList /// @param SortHandling defines how the properties Sorted and Dupplicates are set </summary> @@ -459,6 +458,20 @@ inline; {$ENDIF} +procedure TMemIniFile_ReadSubSections(_Ini: TMemIniFile; const _Section: string; _Sections: TStrings); +{$IFDEF SUPPORTS_INLINE} +inline; +{$ENDIF} +procedure TRegistryIniFile_ReadSubSections(_Ini: TRegistryIniFile; const _Section: string; _Sections: TStrings); +{$IFDEF SUPPORTS_INLINE} +inline; +{$ENDIF} + +procedure TCustomIniFile_ReadSubSections(_Ini: TCustomIniFile; const _Section: string; _Sections: TStrings); +{$IFDEF SUPPORTS_INLINE} +inline; +{$ENDIF} + type TIniSection = class private @@ -1655,6 +1668,77 @@ end; end; +{$IFDEF CUSTOMINIFILE_HAS_READSUBSECTIONS} +procedure TMemIniFile_ReadSubSections(_Ini: TMemIniFile; const _Section: string; _Sections: TStrings); +begin + _Ini.ReadSubSections(_Section, _Sections, False); +end; +{$ELSE} +procedure TMemIniFile_ReadSubSections(_Ini: TMemIniFile; const _Section: string; _Sections: TStrings); +var + i: Integer; + Len: Integer; + s: string; +begin + _Ini.ReadSections(_Section, _Sections); + Len := Length(_Section); + if Len = 0 then begin + // we only want top level sections, that is those that do not contain a '\' + for i := _Sections.Count - 1 downto 0 do begin + if Pos('\', _Sections[i]) > 0 then + _Sections.Delete(i); + end; + end else begin + for i := _Sections.Count - 1 downto 0 do begin + s := TailStr(_Sections[i], Len + 2); + if (s = '') or (Pos('\', s) > 0) then + _Sections.Delete(i) + else begin + _Sections[i] := s; + end; + end; + end; +end; +{$ENDIF} + +{$IFDEF CUSTOMINIFILE_HAS_READSUBSECTIONS} +procedure TRegistryIniFile_ReadSubSections(_Ini: TRegistryIniFile; const _Section: string; _Sections: TStrings); +begin + _Ini.ReadSubSections(_Section, _Sections, False); +end; +{$ELSE} +procedure TRegistryIniFile_ReadSubSections(_Ini: TRegistryIniFile; const _Section: string; _Sections: TStrings); +var + Reg: TRegistry; +begin + if _Section = '' then begin + _Ini.ReadSections(_Sections); + Exit; //==> + end; + + _Sections.Clear; + Reg := TRegistry.Create; + try + Reg.RootKey := _Ini.RegIniFile.RootKey; + if not Reg.OpenKeyReadOnly(_Ini.Filename + '\' + _Section) then + Exit; //==> + + Reg.GetKeyNames(_Sections); + finally + FreeAndNil(Reg); + end; +end; +{$ENDIF} + +procedure TCustomIniFile_ReadSubSections(_Ini: TCustomIniFile; const _Section: string; _Sections: TStrings); +begin + if _Ini is TMemIniFile then + TMemIniFile_ReadSubSections(TMemIniFile(_Ini), _Section, _Sections) + else if _Ini is TRegistryIniFile then + TRegistryIniFile_ReadSubSections(TRegistryIniFile(_Ini), _Section, _Sections) + else + raise EdzException.CreateFmt(_('Only implemented for TMemIniFile and TRegistryIniFile but not %s'), [_Ini.ClassName]); +end; { TStringsUpdateInt } constructor TStringsUpdateInt.Create(_Strings: TStrings); Modified: trunk/ExternalSource/dzlib/u_dzTranslator.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzTranslator.pas 2021-08-14 13:25:21 UTC (rev 3579) +++ trunk/ExternalSource/dzlib/u_dzTranslator.pas 2021-08-14 16:07:11 UTC (rev 3580) @@ -267,7 +267,7 @@ begin {$IFDEF gnugettext} Result := gnugettext.GetCurrentLocaleName; -{$ESLE} +{$ELSE} Result := ''; {$ENDIF} end; Modified: trunk/ExternalSource/dzlib/u_dzTypes.pas =================================================================== --- trunk/ExternalSource/dzlib/u_dzTypes.pas 2021-08-14 13:25:21 UTC (rev 3579) +++ trunk/ExternalSource/dzlib/u_dzTypes.pas 2021-08-14 16:07:11 UTC (rev 3580) @@ -68,6 +68,13 @@ {$IF not declared(NativeUInt) or (SizeOf(Pointer) <> SizeOf(NativeUInt))} NativeUInt = UInt32; {$IFEND} +{$IF not declared(IntPtr))} +{$IF SizeOf(Pointer)=4} + IntPtr = Int32; +{$ELSE} + IntPtr = Int64; +{$IFEND} +{$IFEND} {$IF not declared(UIntPtr)} {$IF SizeOf(Pointer)=4} UIntPtr = UInt32; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |