Cyclone 3DR Script
from Technodigit, part of Hexagon. Copyright 1997-2021.
SFile Class Reference

The Sfile class provides an interface for reading from and writing to files. More...

Inheritance diagram for SFile:
SObject

Public Types

enum  OpenModeEnum {
  ReadOnly , WriteOnly , ReadWrite , Append ,
  Truncate
}
 

Public Slots

Boolean AtEnd ()
 Returns true if the current read and write position is at the end of the file (i.e. there is no more data available for reading on the file); otherwise returns false. More...
 
 Close ()
 To close the file. More...
 
Boolean Exists ()
 To check if the file exists. More...
 
String FileName ()
 Return the name set by the SFile constructor. More...
 
Boolean IsOpen ()
 Returns true if the file is open; otherwise returns false. A file is open if it can be read from and/or written to. More...
 
static SFile New (String name)
 Constructs a new file object to represent the file with the given name. More...
 
Boolean Open (OpenModeEnum OpenMode)
 Opens the existing file (The file is always open in text mode). Returns true if successful; otherwise returns false. More...
 
String ReadAll ()
 Reads all available data from the file, and returns it as a string. More...
 
String ReadLine ()
 Reads a line from the file. More...
 
Boolean Remove ()
 Removes the file specified by the FileName(). Returns true if successful; otherwise returns false. More...
 
static Boolean Remove (String fileName)
 Removes the file specified by the fileName given. Returns true if successful; otherwise returns false. More...
 
Boolean Rename (String NewName)
 Renames the file currently specified by FileName() to NewName. Returns true if successful; otherwise returns false. More...
 
String toString ()
 Get the type of the variable. More...
 
static String toString ()
 Get the type of the variable. More...
 
Boolean Write (String ToWrite)
 Writes the content of string to the file. Returns true if successful; otherwise returns false if an error occurred. More...
 
- Public Slots inherited from SObject
 Clear ()
 To deallocate memory of the object. More...
 
String toString ()
 Get the type of the variable. More...
 

Detailed Description

The Sfile class provides an interface for reading from and writing to files.

Member Enumeration Documentation

◆ OpenModeEnum

Enumerator
ReadOnly 
WriteOnly 
ReadWrite 
Append 
Truncate 

Member Function Documentation

◆ AtEnd

Boolean SFile::AtEnd ( )
slot

Returns true if the current read and write position is at the end of the file (i.e. there is no more data available for reading on the file); otherwise returns false.

◆ Close

SFile::Close ( )
slot

To close the file.

◆ Exists

Boolean SFile::Exists ( )
slot

To check if the file exists.

◆ FileName

String SFile::FileName ( )
slot

Return the name set by the SFile constructor.

◆ IsOpen

Boolean SFile::IsOpen ( )
slot

Returns true if the file is open; otherwise returns false. A file is open if it can be read from and/or written to.

◆ New

static SFile SFile::New ( String  name)
staticslot

Constructs a new file object to represent the file with the given name.

◆ Open

Boolean SFile::Open ( OpenModeEnum  OpenMode)
slot

Opens the existing file (The file is always open in text mode). Returns true if successful; otherwise returns false.

◆ ReadAll

String SFile::ReadAll ( )
slot

Reads all available data from the file, and returns it as a string.

◆ ReadLine

String SFile::ReadLine ( )
slot

Reads a line from the file.

◆ Remove [1/2]

Boolean SFile::Remove ( )
slot

Removes the file specified by the FileName(). Returns true if successful; otherwise returns false.

◆ Remove [2/2]

static Boolean SFile::Remove ( String  fileName)
staticslot

Removes the file specified by the fileName given. Returns true if successful; otherwise returns false.

◆ Rename

Boolean SFile::Rename ( String  NewName)
slot

Renames the file currently specified by FileName() to NewName. Returns true if successful; otherwise returns false.

◆ toString [1/2]

String SFile::toString ( )
slot

Get the type of the variable.

◆ toString [2/2]

static String SFile::toString ( )
staticslot

Get the type of the variable.

◆ Write

Boolean SFile::Write ( String  ToWrite)
slot

Writes the content of string to the file. Returns true if successful; otherwise returns false if an error occurred.