Too much to document

This commit is contained in:
mysticbbs 2013-03-22 23:17:15 -04:00
parent 5cca241ff5
commit a0fa3890db
4 changed files with 49 additions and 8 deletions

View File

@ -31,6 +31,7 @@ Function JustFileName (Str: String) : String;
Function JustFile (Str: String) : String; Function JustFile (Str: String) : String;
Function JustFileExt (Str: String) : String; Function JustFileExt (Str: String) : String;
Function JustPath (Str: String) : String; Function JustPath (Str: String) : String;
Function WildMatch (WildCard, FName: String; IgnoreCase: Boolean) : Boolean;
Function DirCreate (Str: String) : Boolean; Function DirCreate (Str: String) : Boolean;
Function DirExists (Str: String) : Boolean; Function DirExists (Str: String) : Boolean;
Function DirSlash (Str: String) : String; Function DirSlash (Str: String) : String;
@ -409,6 +410,37 @@ Begin
End; End;
End; End;
Function WildMatch (WildCard, FName: String; IgnoreCase: Boolean) : Boolean;
Begin
Result := False;
If FName = '' Then Exit;
If IgnoreCase Then Begin
WildCard := strUpper(WildCard);
FName := strUpper(FName);
End;
Case Wildcard[1] of
'*' : Begin
If FName[1] = '.' Then Exit;
If Length(Wildcard) = 1 Then Result := True;
If (Length(Wildcard) > 1) and (Wildcard[2] = '.') and (Length(FName) > 0) Then
Result := WildMatch(Copy(Wildcard, 3, Length(Wildcard) - 2), Copy(FName, Pos('.', FName) + 1, Length(FName)-Pos('.', FName)), False);
End;
'?' : If Ord(Wildcard[0]) = 1 Then
Result := True
Else
Result := WildMatch(Copy(Wildcard, 2, Length(Wildcard) - 1), Copy(FName, 2, Length(FName) - 1), False);
Else
If FName[1] = Wildcard[1] Then
If Length(Wildcard) > 1 Then
Result := WildMatch(Copy(Wildcard, 2, Length(Wildcard) - 1), Copy(FName, 2, Length(FName) - 1), False)
Else
Result := (Length(FName) = 1) And (Length(Wildcard) = 1);
End;
End;
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
Function FileErase (Str: String) : Boolean; Function FileErase (Str: String) : Boolean;
Begin Begin
@ -762,7 +794,7 @@ Function FileByteSize (FN: String) : Int64;
Var Var
Dir : SearchRec; Dir : SearchRec;
Begin Begin
Result := -1; Result := 0;
FindFirst (FN, AnyFile, Dir); FindFirst (FN, AnyFile, Dir);

View File

@ -15,6 +15,7 @@ Type
Constructor Create (FN: String); Constructor Create (FN: String);
Destructor Destroy; Override; Destructor Destroy; Override;
Procedure SetSequential (S: Boolean);
Function ReadString (Category, Value, DefValue: String) : String; Function ReadString (Category, Value, DefValue: String) : String;
Function ReadInteger (Category, Value: String; DefValue: LongInt) : LongInt; Function ReadInteger (Category, Value: String; DefValue: LongInt) : LongInt;
Function ReadBoolean (Category, Value: String; DefValue: Boolean) : Boolean; Function ReadBoolean (Category, Value: String; DefValue: Boolean) : Boolean;
@ -44,6 +45,13 @@ Begin
If Opened Then Close(IniFile); If Opened Then Close(IniFile);
End; End;
Procedure TIniReader.SetSequential (S: Boolean);
Begin
Sequential := S;
If Opened Then Reset(IniFile);
End;
Function TIniReader.ReadString (Category, Value, DefValue: String) : String; Function TIniReader.ReadString (Category, Value, DefValue: String) : String;
Var Var
RawStr : String; RawStr : String;

View File

@ -28,7 +28,7 @@
------------------------------------------------------------------------- -------------------------------------------------------------------------
} }
{.$DEFINE NEWEDITOR} {$DEFINE NEWEDITOR}
{.$DEFINE DEBUG} {.$DEFINE DEBUG}
{$DEFINE RELEASE} {$DEFINE RELEASE}

View File

@ -56,8 +56,8 @@ Const
AppInputSize = 128; AppInputSize = 128;
SDLAppWindowX : Word = 800; SDLAppWindowX : Word = 800;
SDLAppWindowY : Word = 600; SDLAppWindowY : Word = 600;
SDLFontSize : Byte = 16; SDLFontSize : Byte = 17;
SDLFontSpace : Byte = 16; SDLFontSpace : Byte = 0;
Type Type
TSDLScreenMode = (mode_80x25, mode_80x50, mode_132x50); TSDLScreenMode = (mode_80x25, mode_80x50, mode_132x50);
@ -147,7 +147,8 @@ Begin
SDL_INIT(SDL_INIT_VIDEO); SDL_INIT(SDL_INIT_VIDEO);
Screen := SDL_SetVideoMode(SDLAppWindowX, SDLAppWindowY, 32, SDL_HWSURFACE or SDL_FULLSCREEN); // Screen := SDL_SetVideoMode(SDLAppWindowX, SDLAppWindowY, 32, SDL_HWSURFACE or SDL_FULLSCREEN);
Screen := SDL_SetVideoMode(SDLAppWindowX, SDLAppWindowY, 32, SDL_HWSURFACE);
If Screen = NIL Then Halt; If Screen = NIL Then Halt;