C++ Implementation The C++ implementation is composed of the source files listed below. -
X12ToXML.cpp : the main routine for the C++ application with an X12 interchange as source -
X12SourceConverter.cpp : the class that drives conversion from X12 to XML -
X12SourceConverter.h : the header file for the X12SourceConverter class -
EDIRecordReader.cpp : the class that handles reading EDI segments and converting to XML -
EDIRecordReader.h : the header file for the EDIRecordReader class -
X12RecordReader.cpp : the class that handles reading X12 control segments -
X12RecordReader.h : the header file for the X12RecordReader class -
XMLToX12.cpp : the main routine for the C++ application with an X12 interchange as the target -
X12TargetConverter.cpp : the class that drives conversion from XML to an X12 interchange -
X12TargetConverter.h : the header file for the X12TargetConverter class -
EDIRecordWriter.cpp : the class that handles reading XML and building and writing EDI segments -
EDIRecordWriter.h : the header file for the EDIRecordWriter class -
X12RecordWriter.cpp : the class that handles building and writing X12 control segments -
X12RecordWriter.h : the header file for the X12RecordWriter class -
DataCellX12N.cpp : the class that handles the X12 Number data type -
DataCellX12N.h : the header file for the DataCellX12N class -
DataCellX12R.cpp : the class that handles the X12 Decimal data type -
DataCellX12R.h : the header file for the DataCellX12R class -
DataCellX12DT.cpp : the class that handles the X12 Date data type -
DataCellX12DT.h : the header file for the DataCellX12DT class -
DataCellX12TM.cpp : the class that handles the X12 Time data type -
DataCellX12TM.h : the header file for the DataCellX12TM class The writeISA method uses the time and localtime functions from time.h to get the date and time for the interchange and group headers. // Set time zone from TZ environment variable. If TZ is not set, // the operating system is queried to obtain the default value // for the variable. // tzset(); // Get System Time time( <ime ); today = localtime( <ime ); sprintf(cYear,"%d",(today->tm_year + 1900)); sprintf(cMonth,"%02d",(today->tm_mon + 1)); sprintf(cDay,"%02d",(today->tm_mday )); sprintf(cHour,"%02d",(today->tm_hour )); sprintf(cMinute,"%02d",(today->tm_min )); The X12RecordReader's methods that parse control segments use the familiar C strtok function. |