From e060f08b82d45510f202c59cd92877cac67729aa Mon Sep 17 00:00:00 2001 From: tobigun Date: Mon, 12 Jan 2009 16:29:21 +0000 Subject: - UTF8CompareStr, UTF8CompareText, UTF8StartsText, UTF8ContainsStr, UTF8ContainsText, UTF8UpperCase, UTF8LowerCase added - StringReplaceW moved from UCommon.pas to UUnicodeUtils.pas git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@1560 b956fd51-792f-4845-bead-9b4dfca2ff2c --- unicode/src/base/UCommon.pas | 40 ++++++---------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) (limited to 'unicode/src/base/UCommon.pas') diff --git a/unicode/src/base/UCommon.pas b/unicode/src/base/UCommon.pas index 234e4ddb..f5697916 100644 --- a/unicode/src/base/UCommon.pas +++ b/unicode/src/base/UCommon.pas @@ -46,28 +46,26 @@ uses type TMessageType = ( mtInfo, mtError ); -procedure ShowMessage( const msg : String; msgType: TMessageType = mtInfo ); +procedure ShowMessage(const msg : String; msgType: TMessageType = mtInfo); procedure ConsoleWriteLn(const msg: string); function RWopsFromStream(Stream: TStream): PSDL_RWops; {$IFDEF FPC} -function RandomRange(aMin: Integer; aMax: Integer) : Integer; +function RandomRange(aMin: Integer; aMax: Integer): Integer; {$ENDIF} -function StringReplaceW(text : WideString; search, rep: WideChar):WideString; -function AdaptFilePaths( const aPath : widestring ): widestring; - procedure DisableFloatingPointExceptions(); procedure SetDefaultNumericLocale(); procedure RestoreNumericLocale(); {$IFNDEF MSWINDOWS} - procedure ZeroMemory( Destination: Pointer; Length: DWORD ); + procedure ZeroMemory(Destination: Pointer; Length: DWORD); function MakeLong(a, b: Word): Longint; {$ENDIF} +function AdaptFilePaths(const aPath: widestring): widestring; function FileExistsInsensitive(var FileName: string): boolean; // A stable alternative to TList.Sort() (use TList.Sort() if applicable, see below) @@ -84,7 +82,8 @@ uses {$IFDEF Delphi} Dialogs, {$ENDIF} - UMain; + UMain, + UUnicodeUtils; // data used by the ...Locale() functions @@ -207,33 +206,6 @@ begin exOverflow, exUnderflow, exPrecision]); end; -function StringReplaceW(text : WideString; search, rep: WideChar) : WideString; -var - iPos : integer; -// sTemp : WideString; -begin -(* - result := text; - iPos := Pos(search, result); - while (iPos > 0) do - begin - sTemp := copy(result, iPos + length(search), length(result)); - result := copy(result, 1, iPos - 1) + rep + sTEmp; - iPos := Pos(search, result); - end; -*) - result := text; - - if search = rep then - exit; - - for iPos := 1 to length(result) do - begin - if result[iPos] = search then - result[iPos] := rep; - end; -end; - function AdaptFilePaths( const aPath : widestring ): widestring; begin result := StringReplaceW( aPath, '\', PathDelim );//, [rfReplaceAll] ); -- cgit v1.2.3