#include <DrawFile.h>
Inheritance diagram for DrawFile:
Static Public Methods | |
Drawing * | read_file (std::string filename) |
Read a drawing file from a file. | |
bool | write_file (std::string filename, Drawing *d) |
Write the contents of a drawing to a file. | |
Protected Methods | |
DrawFile (std::string filename) | |
virtual | ~DrawFile () |
virtual Drawing * | read_drawing ()=0 |
Protected Attributes | |
std::string | filename |
|
00039 : filename(fn) 00040 { } |
|
00029 {} |
|
Implemented in XMLDrawFile. |
|
Read a drawing file from a file. The filename is opened for reading. If errors are encountered, error messages are printed to stderr.
00043 { 00044 ifstream input(filename.c_str()); 00045 00046 if (!input) { 00047 cerr << "Cannot open " << filename << " for reading." << endl; 00048 return 0; 00049 } 00050 00051 XMLDrawFile df(filename,input,cerr); 00052 // assume XML syntax 00053 00054 return df.read_drawing(); 00055 } |
|
Write the contents of a drawing to a file. The filename is opened for writing and the drawing written.
00189 { 00190 cerr << "Saving drawing is unimplemented!" << endl; 00191 return false; // unimplemented 00192 } |
|
|