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 Wildcard Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Strifile Source Code
 previous   up   next 

Types
strifile
File implementation type for files stored in a string.

strifile

const type: strifile

File implementation type for files stored in a string.


Function Summary
file
openStrifile (in string: content)
Open a strifile with the given string content.
file
openStrifile
Open a strifile with an empty string content.
void
write (inout strifile: outStrifile, in string: stri)
Write the string stri to outStrifile.
char
getc (inout strifile: inStrifile)
Read a character from inStrifile.
string
gets (inout strifile: inStrifile, in var integer: maxLength)
Read a string with maximum length from inStrifile.
string
getwd (inout strifile: inStrifile)
Read a word from inStrifile.
string
getln (inout strifile: inStrifile)
Read a line from inStrifile.
boolean
eof (in strifile: inStrifile)
Determine the end-of-file indicator.
boolean
hasNext (in strifile: inStrifile)
Determine if at least one character can be read successfully.
integer
length (in strifile: aStrifile)
Obtain the length of a aStrifile.
void
seek (inout strifile: aStrifile, in integer: position)
Set the current file position.
integer
tell (in strifile: aStrifile)
Obtain the current file position of aStrifile.

Function Detail

openStrifile

const func file: openStrifile (in string: content)

Open a strifile with the given string content.

Returns:
the file opened.

openStrifile

const func file: openStrifile

Open a strifile with an empty string content.

Returns:
the file opened.

write

const proc: write (inout strifile: outStrifile, in string: stri)

Write the string stri to outStrifile.


getc

const func char: getc (inout strifile: inStrifile)

Read a character from inStrifile.

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

gets

const func string: gets (inout strifile: inStrifile, in var integer: maxLength)

Read a string with maximum length from inStrifile.

Returns:
the string read.

getwd

const func string: getwd (inout strifile: inStrifile)

Read a word from inStrifile. Before reading the word it skips spaces and tabs. The function accepts words ending with " ", "\t", "\n", or EOF. The word ending characters are not copied into the string. When the function is left inStrifile.bufferChar contains ' ', '\t', '\n' or EOF.

Returns:
the word read.

getln

const func string: getln (inout strifile: inStrifile)

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

Returns:
the line read.

eof

const func boolean: eof (in strifile: inStrifile)

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 strifile: inStrifile)

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 strifile: aStrifile)

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

Returns:
the length of a file.

seek

const proc: seek (inout strifile: aStrifile, in integer: position)

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


tell

const func integer: tell (in strifile: aStrifile)

Obtain the current file position of aStrifile. 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.


 previous   up   next