
Procedure for Using the C++ Interface
The procedure to invoke the generated decode method is similar to that for the other encoding rules. It is as follows:
int main (int argc, char* argv[]) { const char* filename = "employee.xml"; int stat; // steps 1, 2, and 3: instantiate an instance of the XER // decoding classes. This example specifies an XML file // as the message input source.. ASN1T_PersonnelRecord employee; ASN1XERDecodeBuffer decodeBuffer (filename); ASN1C_PersonnelRecord employeeC (decodeBuffer, employee); // step 4: invoke the decode method stat = employeeC.Decode (); if (0 == stat) { employeeC.Print ("employee"); } else decodeBuffer.printErrorInfo (); // step 5: dynamic memory is released when employeeC and // decode buffer objects go out of scope. return (stat); }
Objective Systems, Inc.55 Dowlin Forge RoadExton, 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 |