This commit is contained in:
mysticbbs 2013-08-05 12:51:08 -04:00
parent 9909d064a5
commit 41316ef5a6
3 changed files with 42 additions and 2 deletions

View File

@ -51,7 +51,7 @@ Type
Procedure BufWriteStr (Str: String); Override;
Function WriteLine (Str: String) : LongInt; Override;
Function WriteStr (Str: String) : LongInt; Override;
Function WriteFile (Str: String) : Boolean;
Function WriteFile (Prefix, FileName: String) : Boolean;
Function WriteBufEscaped (Var Buf: TIOBuffer; Var Len: LongInt) : LongInt;
Procedure TelnetInBuffer (Var Buf: TIOBuffer; Var Len: LongInt);
Function ReadBuf (Var Buf; Len: LongInt) : LongInt; Override;
@ -228,6 +228,37 @@ Begin
Result := fpSend(FSocketHandle, @Str[1], Length(Str), FPSENDOPT);
End;
Function TIOSocket.WriteFile (Prefix, FileName: String) : Boolean;
Var
T : Text;
S : String;
Begin
Result := False;
FileMode := 66;
Assign (T, FileName);
Reset (T);
If IoResult <> 0 Then Exit;
While Not Eof(T) Do Begin
ReadLn (T, S);
If Prefix <> '' Then
If EOF(T) Then
S := Prefix + ' ' + S
Else
S := Prefix + '- ' + S;
WriteLine(S);
End;
Close (T);
Result := True;
End;
(*
Function TIOSocket.WriteFile (Str: String) : Boolean;
Var
Buf : Array[1..4096] of Char;
@ -255,6 +286,7 @@ Begin
Result := True;
End;
*)
Function TIOSocket.WriteBufEscaped (Var Buf: TIOBuffer; Var Len: LongInt) : LongInt;
Var

View File

@ -21,6 +21,7 @@
$LINUX : Set if target OS is linux
$WINDOWS : Set if target OS is windows
$DARWIN : Set if target OS is Mac OSX
$OS2 : Set if target OS is OS2
FILE SYSTEMS:
$FS_SENSITIVE : Set if target file system is case sensitive
@ -51,6 +52,10 @@
{$DEFINE FS_IGNORE}
{$ENDIF}
{$IFDEF OS2}
{$DEFINE FS_IGNORE}
{$ENDIF}
{ ------------------------------------------------------------------------- }
{$MODE DELPHI}

View File

@ -75,8 +75,10 @@ Begin
Result := True;
For Count := 1 to 80 Do
If (Buffer[Line][Count].UnicodeChar <> #0) and ((Buffer[Line][Count].UnicodeChar <> ' ') and (Buffer[Line][Count].Attributes <> 7)) Then Begin
// If (Buffer[Line][Count].UnicodeChar <> #0) and ((Buffer[Line][Count].UnicodeChar <> ' ') and (Buffer[Line][Count].Attributes <> 7)) Then Begin
If (Buffer[Line][Count].UnicodeChar <> #0) and ((Buffer[Line][Count].UnicodeChar <> ' ') or (Buffer[Line][Count].Attributes <> 7)) Then Begin
Result := False;
Exit;
End;
End;
@ -95,6 +97,7 @@ Begin
While Line > 0 Do Begin
If Not IsBlankLine(Line) Then Break;
Dec(Line);
End;