Defined in:Parses an OpenDDL file and processes the top-level data structures.
DataResult ProcessText(const char *text);
||The full contents of an OpenDDL file with a terminating zero byte.|
ProcessTextfunction parses the entire OpenDDL file specified by the
textparameter. If the file is successfully parsed, then the data is processed as described below. If an error occurs during the parsing stage, then the
ProcessTextfunction returns one of the following values, and the
DataDescriptionobject contains no data. During the parsing stage, the
DataDescription::CreateStructurefunction is called for each custom data structure that is encountered in order to construct an object whose type is the proper subclass of the
Structureclass. After a successful parse, the
ProcessTextfunction iterates through all of the top-level data structures in the file (which are the direct subnodes of the root structure returned by the
DataDescription::GetRootStructurefunction) and calls the
Structure::ProcessDatafunction for each one. If an error is returned by any of the calls to the
Structure::ProcessDatafunction, then the processing stops, and the same error is returned by the
DataDescription::ProcessTextfunction. If all of the top-level data structures are processed without error, then the
kDataOkay. The error returned during the processing stage can be one of the following values or a value defined by a derivative data format.
||A structure is missing a substructure of a required type.|
||A structure contains too many substructures of a legal type.|
||The primitive data contained in a structure uses an invalid format (type, subarray size, or state data).|
||The target of a reference does not exist.|
The default implementation of the
Structure::ProcessDatafunction iterates over the direct subnodes of a data structure and calls the
ProcessDatafunction for each one. If all overrides call the base class implementation, then the entire tree of data structures will be visited during the processing stage.
Any implementation of the
Structure::ProcessDatafunction may make the following assumptions about the data:
1. The input text is syntactically valid.
2. Each structure described in the input text was recognized and successfully created.
3. Each structure is valid as indicated by the
Structure::ValidateSubstructurefunction called for its enclosing structure.
4. Each property identifier is valid as indicated by the
Structure::ValidatePropertyfunction called for the associated structure, and it has a value of the proper type assigned to it.
5. Any existing subarrays of primitive data have the correct number of elements, matching the number specified in brackets after the primitive type identifier.
6. Any existing state identifiers associated with primitive data subarrays are valid as indicated by the