SatFile
List of: Classes
Subjects: SAT Save and Restore
Contents: Kernel

Purpose: Defines the SatFile class for doing ACIS save and restore to stream files in text format.

Derivation: SatFile : FileInterface : ACIS_OBJECT : -

Filename: kern/kernel/kernutil/fileio/satfile.hxx

Description: Defines the SatFile class for doing ACIS save and restore to stream files in text format.

Constructor: public: SatFile::SatFile (


FILE* // filename


);


C++ constructor, creating a SatFile using the specified parameters.




Destructor: public: virtual SatFile::~SatFile ();


C++ destructor, deleting a SatFile.



Methods: public: virtual FilePosition SatFile::goto_mark (


FilePosition // file position


);


Moves the file pointer to the specified pointer in the SatFile.






public: virtual char SatFile::read_char ();


Reads a character. Written with C printf format "%c".






public: virtual TaggedData* SatFile::read_data ();


Reads the data for an unknown ENTITY until the end of record terminator is reached.






public: virtual double SatFile::read_double ();


Reads a double. Written with C printf format "%g ".






public: virtual int SatFile::read_enum (


enum_table const& // enumeration table


);


Read an enumeration table. The <identifier> specifies which enumeration is active and its valid values. The <identifier> is not written to the file. A valid value only is written to the file. This is a character string or a long value from the enumeration <identifier> written with C printf format "%s".






public: virtual float SatFile::read_float ();


Reads a float. Written with C printf format "%g ".






public: virtual logical SatFile::read_header (


int&, // first integer


int&, // second integer


int&, // third integer


int& // fourth integer


);


Reads a header. The first record of the ACIS save file is a header, such as: 200 0 1 0


First Integer: An encoded version number. In the example, this is "200". This value is 100 times the major version plus the minor version (e.g., 107 for ACIS version 1.7). For point releases, the final value is truncated. Part save data for the .sat files is not affected by a point release (e.g., 105 for ACIS version 1.5.2).


Second Integer: The total number of saved data records, or zero. If zero, then there needs to be an end mark.


Third Integer: A count of the number of entities in the original entity list saved to the part file.


Fourth Integer: The least significant bit of this number is used to indicate whether or not history has been saved in this save file.






public: virtual int SatFile::read_id (


char*, // title


int
// integer



= 0


);


Reads an identifier. The save identifier written with C printf format "%s ".






public: virtual logical SatFile::read_logical (


const char* f // title



= "F",


const char* t // title



= "T"


);


Reads a logical. (false_string, true_string {or any_valid_string}): Appropriate string written with C printf format "%s ".






public: virtual long SatFile::read_long ();


Reads a long. Written with C printf format "%ld".






public: virtual void* SatFile::read_pointer ();


Reads a pointer. Pointer reference to a save file record index. Written as "$" followed by index number written as a long.






public: virtual int SatFile::read_sequence ();


Reads a sequence. Written as "-" followed by the entity index written as long.






public: virtual short SatFile::read_short ();


Reads a short. Written with C printf format "%d".






public: virtual char* SatFile::read_string (


int& // integer


);


Reads a string, allocates memory for it, and the argument returns the length of the string. Length written as long followed by string written with C printf format "%s".






public: virtual size_t SatFile::read_string (


char* buf, // buffer


size_t maxlen // maximum length



= 0


);


Reads a string into a supplied buffer of a given size, maxlen.






public: virtual logical SatFile::read_subtype_end ();


Reads subtype end. Braces around the subtypes, written as "} ".






public: virtual logical


SatFile::read_subtype_start ();


Reads subtype start. Braces around the subtypes, written as "{ ".






public: virtual FilePosition SatFile::set_mark ();


Returns the current file position within the SatFile.






public: virtual void SatFile::write_char (


char // character


);


Writes a character. Written with C printf format "%c".






public: virtual void SatFile::write_double (


double // parameter


);


Writes a real. Written with C printf format "%g ".






public: virtual void SatFile::write_enum (


int, // number in


enum_table const& // enumeration table


);


Writes enumeration table. The <identifier> specifies which enumeration is active and its valid values. The <identifier> is not written to the file. A valid value only is written to the file. This is a character string or a long value from the enumeration <identifier> written with C printf format "%s".






public: virtual void SatFile::write_float (


float // float


);


Writes a float. Written with C printf format "%g ".






public: virtual void SatFile::write_header (


int, // first integer


int, // second integer


int, // third integer


int
// fourth integer


);


Writes a header. The first record of the ACIS save file is a header, such as: 200 0 1 0


First Integer: An encoded version number. In the example, this is "200". This value is 100 times the major version plus the minor version (e.g., 107 for ACIS version 1.7). For point releases, the final value is truncated. Part save data for the .sat files is not affected by a point release (e.g., 105 for ACIS version 1.5.2).


Second Integer: The total number of saved data records, or zero. If zero, then there needs to be an end mark.


Third Integer: A count of the number of entities in the original entity list saved to the part file.


Fourth Integer: The least significant bit of this number is used to indicate whether or not history has been saved in this save file.






public: virtual void SatFile::write_id (


const char*, // character


int
// integer


);


Writes an identifier. The save identifier written with C printf format "%s ".






public: virtual void SatFile::write_literal_string (


const char*, // character


size_t len // length



= 0


);


Writes a literal string.






public: virtual void SatFile::write_logical (


logical, // logical


const char* f // character



= "F",


const char* t // character



= "T"


);


Writes a logical. (false_string, true_string, {or any_valid_string}): Appropriate string written with C printf format "%s ".






public: virtual void SatFile::write_long (


long // long


);


Writes a long. Written with C printf format "%ld".






public: virtual void SatFile::write_newline (


int
// number of newlines



= 1


);


Writes a new line.






public: virtual void SatFile::write_pointer (


void* // parameter


);


Writes a pointer. Pointer reference to a save file record index. Written as "$" followed by index number written as a long.






public: virtual void SatFile::write_sequence (


int
// integer


);


Writes a sequence. Written as "-" followed by the entity index written as long.






public: virtual void SatFile::write_short (


short // short


);


Writes a short. Written with C printf format "%d".






public: virtual void SatFile::write_string (


const char*, // character


size_t len // length



= 0


);


Writes a string. Length written as long followed by string written with C printf format "%s".






public: virtual void SatFile::write_subtype_end ();


Writes a subtype end. Braces around the subtypes, written as "} ".






public: virtual void SatFile::write_subtype_start ();


Writes a subtype start. Braces around the subtypes, written as "{ ".






public: virtual void SatFile::write_terminator ();


Writes a terminator. Written as "#".
PDF/KERN/36CLSA.PDF
HTM/DATA/KERN/KERN/36CLSA/0002.HTM