
C++ Code Generated for XSD Types
For C++, a class definition is generated for each XSD type. This class is derived from either the OSBaseType run-time class or from a descendent of this class. The class may contain a constructor for initialization of member variables and a destructor to free dynamic memory held by the class. Method declarations will also be generated instead of C function prototypes for encoding, decoding, printing, and generation of test data. For some types, additional helper methods may also be declared (for example, enumerated type definitions contain a toString method declaration).
A sample section from a C++ header file corresponding to the XSD Name type defined above is as follows:
/**************************************************************/ /* */ /* Name */ /* */ /**************************************************************/ class EXTERN Name : public OSBaseType { public: OSXMLStringClass givenName; OSXMLStringClass initial; OSXMLStringClass familyName; int encodeXML (OSCTXT* pctxt, const OSUTF8CHAR* elemName, const OSUTF8CHAR* nsPrefix); void print (const char* name); } ;
Objective Systems, Inc.102 Pickering Way, Suite #506Exton, Pennsylvania 19341 http://www.obj-sys.com Phone: (484) 875-9841 Toll-free: (877) 307-6855 (US only) Fax: (484) 875-9830 info@obj-sys.com |