cppOpenCD
UseCase3
// This function should be called after the user has selected a file
// to open. fileName should be a string representing the directory
// path and file name of the source file. The return value of int
// can be used as a flag to indicate if the file load was successful.
// It should call cppDrawEdges() and cppDrawVertices() after g_parse
// returns a legal object.
//
// Modification History:
//
// 11/21/95 - Tom Kneeland (tomk@ccs.neu.edu)
// Added a call to cppFixEdgeObjs() to remove the duplicate vertex objects
// created when the file fileName was parsed in.
// Reversed the calling order of cppDrawVerticies() and cppDrawEdges()
// per request of the tcl group.
*operation* int cppOpenCD (char* fileName)
*wrapper* Graph
*prefix*
(@ if ((Graph*) this -> g_parse(fileName) == NULL )
return_val = 0; // return 0 if g_parse finds error
else {
this->cppFixEdgeObjs();
this -> cppDrawVertices();
this -> cppDrawEdges();
return_val = 1; // return 1 if no g_parse error
}
@)