aboutsummaryrefslogtreecommitdiffstats
path: root/unicode/src/base/UCommon.pas
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-01-12 16:29:21 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2009-01-12 16:29:21 +0000
commite060f08b82d45510f202c59cd92877cac67729aa (patch)
tree713b4eff5f48009f9ceef968fe97d046623f347b /unicode/src/base/UCommon.pas
parentd91f80979165e37e6d5b102ea55d898da8bdd95a (diff)
downloadusdx-e060f08b82d45510f202c59cd92877cac67729aa.tar.gz
usdx-e060f08b82d45510f202c59cd92877cac67729aa.tar.xz
usdx-e060f08b82d45510f202c59cd92877cac67729aa.zip
- 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
Diffstat (limited to 'unicode/src/base/UCommon.pas')
-rw-r--r--unicode/src/base/UCommon.pas40
1 files changed, 6 insertions, 34 deletions
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] );