Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Stritext Source Code
 previous   up   next 

Types
stritext
Text implementation type for files stored in a string array.

stritext

const type: stritext

Text implementation type for files stored in a string array.


Function Summary
file
openStritext (in array string: content)
Open a stritext with the given string array content.
void
write (inout stritext: outStritext, in string: stri)
Write the string stri to outStritext.
char
getc (inout stritext: inStritext)
Read a character from inStritext.
string
gets (inout stritext: inStritext, in var integer: maxLength)
Read a string with a maximum length from inStritext.
string
getln (inout stritext: inStritext)
Read a line from inStritext.
boolean
eof (in stritext: inStritext)
Determine the end-of-file indicator.
boolean
hasNext (in stritext: inStritext)
Determine if at least one character can be read successfully.
integer
length (in stritext: aStritext)
Obtain the length of a aStritext.
integer
tell (in stritext: aStritext)
Obtain the current file position of aStritext.
integer
height (in stritext: aStritext)
Get the height of aStritext.
integer
width (in stritext: aStritext)
Get the width of aStritext.
integer
line (in stritext: aStritext)
Determine the current line of aStritext.
integer
column (in stritext: aStritext)
Determine the current column of aStritext.
void
setPos (inout stritext: aStritext, in integer: line, in integer: column)
Set the current position of aStritext to line and column.
void
setLine (inout stritext: aStritext, in integer: line)
Set the line of the current position of aStritext.
void
setColumn (inout stritext: aStritext, in integer: column)
Set the column of the current position of aStritext.

Function Detail

openStritext

const func file: openStritext (in array string: content)

Open a stritext with the given string array content.

Returns:
the file opened.

write

const proc: write (inout stritext: outStritext, in string: stri)

Write the string stri to outStritext.


getc

const func char: getc (inout stritext: inStritext)

Read a character from inStritext.

Returns:
the character read, or EOF at the end of the file.

gets

const func string: gets (inout stritext: inStritext, in var integer: maxLength)

Read a string with a maximum length from inStritext.

Returns:
the string read.

getln

const func string: getln (inout stritext: inStritext)

Read a line from inStritext. A stritext works as if all lines end with '\n'. The line ending character is not copied into the string. When the function is left inStritext.bufferChar contains '\n' or EOF.

Returns:
the line read.

eof

const func boolean: eof (in stritext: inStritext)

Determine the end-of-file indicator. The end-of-file indicator is set when at least one request to read from the file failed.

Returns:
TRUE if the end-of-file indicator is set, FALSE otherwise.

hasNext

const func boolean: hasNext (in stritext: inStritext)

Determine if at least one character can be read successfully. This function allows a file to be handled like an iterator.

Returns:
FALSE if 'getc' would return EOF, TRUE otherwise.

length

const func integer: length (in stritext: aStritext)

Obtain the length of a aStritext. The file length is measured in characters.

Returns:
the length of a file.

tell

const func integer: tell (in stritext: aStritext)

Obtain the current file position of aStritext. The file position is measured in characters from the start of the file. The first character in the file has the position 1.

Returns:
the current file position.

height

const func integer: height (in stritext: aStritext)

Get the height of aStritext.

Returns:
the height of aStritext.

width

const func integer: width (in stritext: aStritext)

Get the width of aStritext.

Returns:
the width of aStritext.

line

const func integer: line (in stritext: aStritext)

Determine the current line of aStritext.

Returns:
the current line of aStritext.

column

const func integer: column (in stritext: aStritext)

Determine the current column of aStritext.

Returns:
the current column of aStritext.

setPos

const proc: setPos (inout stritext: aStritext, in integer: line, in integer: column)

Set the current position of aStritext to line and column.


setLine

const proc: setLine (inout stritext: aStritext, in integer: line)

Set the line of the current position of aStritext.


setColumn

const proc: setColumn (inout stritext: aStritext, in integer: column)

Set the column of the current position of aStritext.



 previous   up   next