A device and method for converting between extensible markup language and C++ class
By registering C++ classes and utilizing QT to handle serialization and deserialization attributes, the problem of low conversion efficiency between C++ classes and Extensible Markup Language is solved, achieving efficient cross-platform data conversion.
Patent Information
- Application Number
- CN201911184800.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-27
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2039-11-27
AI Technical Summary
Existing technologies suffer from low conversion efficiency between C++ classes and Extensible Markup Language, resulting in a large amount of duplicated code and low structural reliability.
By registering a C++ class to obtain object instances, using QT to process and determine serialization and deserialization attributes, and outputting and assembling attributes in the format of Extensible Markup Language, the number of conditional statements is reduced and the conversion efficiency is improved.
It reduces the generation of duplicate code, improves the efficiency and reliability of conversion between C++ object instances and Extensible Markup Language, and solves the problem of omissions when the structure changes.
Smart Images

Figure CN112256245B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of programming language technology, and in particular to a device and method for converting between extensible markup language and C++ class. Background Art
[0002] Extensible Markup Language is a markup language used to mark electronic files to make them structured. It provides a unified method to describe and exchange structured data that is independent of applications or vendors. Using plain text to describe data content is simple and easy to understand, and can structure data for easy computer understanding, making XML quickly become a common language for cross-platform and cross-application data exchange.
[0003] In actual use, because the C++ class itself does not have the reflection function like Java and C# languages, it is impossible to effectively convert XML files and C++ objects. Therefore, many judgment statements need to be written to judge the node name for corresponding processing, which generates duplicate code and reduces the conversion efficiency. Therefore, reducing the duplicate code generated by the judgment statement is an urgent problem to be solved. The key to reducing duplicate code is to improve the conversion efficiency between C++ classes and extensible markup language, reduce the problems of low reliability and easy omission when the file structure of extensible markup language changes, and thus improve the conversion efficiency. Summary of the invention
[0004] The invention provides a method for converting between extensible markup language and C++ class, aiming to solve the shortcoming of low conversion rate between C++ class and extensible markup language in the prior art.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A method for converting between an extensible markup language and a C++ class of the present invention comprises the following steps:
[0007] Register the C++ class and obtain the corresponding C++ object instance;
[0008] Determine a serialization attribute, the serialization attribute is obtained by processing the C++ object instance according to QT; determine a deserialization attribute, the deserialization attribute is obtained by processing the extensible markup language according to QT;
[0009] The serialization attributes are output to a file in the format of the extensible markup language to realize the serialization process; and the deserialization attributes of the file are assembled to the object instance to realize the deserialization process.
[0010] By processing C++ object instances and Extensible Markup Language through QT, serialization properties and deserialization properties are determined, the serialization properties are output to a file in the format of Extensible Markup Language to realize the serialization process, and the deserialization properties are assembled to the object instance to realize the deserialization process. This can ensure that Extensible Markup Language improves reliability in structural changes, reduce the problem of inefficiency caused by a large amount of repeated code brought by judgment statements, and improve the conversion efficiency of C++ object instances and extensible language.
[0011] Preferably, the serialization attribute is obtained by QT processing the C++ object instance, including:
[0012] Obtain the serialization attribute according to the C++ object instance,
[0013] The obtained serialized attributes are divided into serialized simple attributes and serialized complex attributes according to the attribute type, and the serialized attributes are put into the corresponding attribute table;
[0014] The deserialized attributes are obtained according to the QT processing extensible markup language, including:
[0015] Assembling the deserialized attributes into the C++ object instance,
[0016] The obtained deserialized attributes are divided into deserialized simple attributes and deserialized complex attributes according to the attribute type, and the deserialized attributes are put into the corresponding attribute table;
[0017] Preferably, the registering a C++ class and obtaining a corresponding C++ object instance comprises:
[0018] Register the class name of the C++ class into the data structure using a standard container to generate a key-value pair;
[0019] Template a generation function for the class instance of the C++ class using a standard container;
[0020] According to the deserialization attribute, the data structure is queried whether there is a corresponding key-value pair. If so, the generation function is called to return the C++ object instance.
[0021] Preferably, the process of outputting the serialization attributes to a file in the format of the extensible markup language to achieve serialization includes:
[0022] Traverse all the serialized attributes until all are processed
[0023] The process of assembling the deserialization attributes of the file to the object instance to realize deserialization includes:
[0024] All of the deserialized attributes are traversed until all are processed.
[0025] A device for converting between extensible markup language and C++ class, comprising:
[0026] Get module, used to register C++ class and get corresponding C++ object instance;
[0027] A processing module, used for determining serialization attributes, the serialization attributes are obtained by processing the C++ object instance according to QT; used for determining deserialization attributes, the deserialization attributes are obtained by processing the extensible markup language according to QT;
[0028] The output module outputs the serialization attributes to a file in the format of the extensible markup language to implement the serialization process; and assembles the deserialization attributes of the file to the object instance to implement the deserialization process.
[0029] Preferably, the processing module comprises:
[0030] A conversion unit, used for obtaining the serialization attribute from the C++ object instance;
[0031] A serialization attribute unit, which divides the acquired serialization attributes into serialization simple attributes and serialization complex attributes according to the attribute type, and puts the serialization attributes into a corresponding attribute table;
[0032] An assembly unit, used for assembling the deserialized attribute into the C++ object instance;
[0033] A deserialization unit, used for dividing the obtained deserialized attributes into deserialized simple attributes and deserialized complex attributes according to the attribute type, and putting the deserialized attributes into the corresponding attribute table;
[0034] Preferably, the acquisition module comprises:
[0035] Registration unit, used to register C++ classes;
[0036] The acquisition unit is used to obtain the corresponding C++ object instance.
[0037] Preferably, the output module comprises:
[0038] A serialization output module, used for outputting the serialization attributes into a file in the format of the extensible markup language to implement the serialization process;
[0039] The deserialization output module is used to assemble the deserialization attributes of the file into the object instance to realize the deserialization process.
[0040] An electronic device, characterized in that it includes a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement a method for converting between extensible markup language and C++ class as described in any of the above items.
[0041] A computer-readable storage medium storing a computer program, wherein the computer program enables a computer to implement a method for converting between an extensible markup language and a C++ class as described in any one of the above when executed.
[0042] The present invention has the following beneficial effects:
[0043] First, register the C++ class and obtain the C++ object instance. The serialization attributes are obtained by QT processing the C++ object instance, and the deserialization attributes are obtained by QT processing the extensible markup language. The serialization attributes are output to the file in the format of the extensible markup language to achieve serialization, and the deserialization attributes of the file are assembled to the object instance to achieve deserialization. Using serialization attributes and deserialization attributes to convert between C++ classes and extensible markup language can reduce the disadvantage of low reliability of extensible markup language due to structural changes, reduce data omissions and the generation of duplicate code during the conversion process, and thus improve conversion efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a first flow chart of a method for converting between extensible markup language and C++ class according to an embodiment of the present invention;
[0045] Figure 2 is a second flow chart of a method for converting between extensible markup language and C++ class according to an embodiment of the present invention;
[0046] Figure 3 is a third flow chart of a method for converting between extensible markup language and C++ class according to an embodiment of the present invention;
[0047] Figure 4 It is a schematic diagram of a device for converting between extensible markup language and C++ class according to an embodiment of the present invention;
[0048] Figure 5 It is a schematic diagram of a processing module of an apparatus for converting between extensible markup language and C++ class according to an embodiment of the present invention;
[0049] Figure 6 It is a schematic diagram of an acquisition module of a device for converting between extensible markup language and C++ class according to an embodiment of the present invention;
[0050] Figure 7It is a schematic diagram of an output module of a device for converting between extensible markup language and C++ class according to an embodiment of the present invention;
[0051] Figure 8 It is a schematic diagram of an electronic device implementing a method for converting between an extensible markup language and a C++ class according to an embodiment of the present invention;
[0052] Fig. 9 It is a specific implementation flow chart of a method for converting between extensible markup language and C++ class according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0054] Before introducing the technical solution of the present invention, a scenario to which the technical solution of the present invention may be applicable is exemplarily introduced.
[0055] Exemplary: Mutual conversion between C++ classes and XML is an important method for C++ classes to work across platforms. C++ object instances include different types, and XML includes different structures. Different types of C++ object instances can be serialized into XML structures, and different XML structures can also be assembled into different types of C++ object instances, thus meeting the requirements for C++ classes to work across platforms.
[0056] Obviously, a large number of structure processing devices are needed for the conversion between complex C++ classes and XML. In the prior art, XML uses structure processing devices to perform structure processing, and a large number of judgment statements need to be added to judge the node names for corresponding processing, resulting in a large amount of repeated code to process the XML structure.
[0057] Example 1
[0058] like Figure 1 As shown, a method for converting between an extensible markup language and a C++ class comprises the following steps:
[0059] S100, register a C++ class and obtain a corresponding C++ object instance;
[0060] S110, determining a serialization attribute, wherein the serialization attribute is obtained by processing the C++ object instance according to QT; determining a deserialization attribute, wherein the deserialization attribute is obtained by processing the extensible markup language according to QT;
[0061] S120, outputting the serialization attributes to a file in the format of the extensible markup language to implement a serialization process; assembling the deserialization attributes of the file to the object instance to implement a deserialization process.
[0062] According to Example 1, when the system registers a C++ class, it will obtain the corresponding C++ object instance. After determining the C++ object instance, the C++ object instance and extensible markup language are processed according to QT to obtain serialization attributes and deserialization attributes, wherein the serialization attributes are output to a file in the format of extensible markup language to realize the serialization process, and the deserialization attributes of the file are assembled to the object instance to realize the deserialization process. This method can reduce the structure processing device used when converting between C++ classes and extensible markup language, thereby reducing duplicate code, thereby improving conversion efficiency and solving the problem of low reliability of extensible markup language structure.
[0063] Example 2
[0064] like Figure 2 As shown, a method for converting between an extensible markup language and a C++ class comprises:
[0065] S210, register the C++ class and obtain the corresponding C++ object instance;
[0066] S220, obtaining the serialization attribute according to the C++ object instance;
[0067] S230, dividing the acquired serialized attributes into serialized simple attributes and serialized complex attributes according to the attribute type, and putting the serialized attributes into the corresponding attribute table;
[0068] S240, assembling the deserialized attributes into the C++ object instance;
[0069] S250 , classifying the obtained deserialized attributes into deserialized simple attributes and deserialized complex attributes according to the attribute type, and putting the deserialized attributes into a corresponding attribute table.
[0070] According to Example 2, the calculated serialized attributes are divided into serialized simple attributes and serialized complex attributes according to type, and the serialized attributes are placed in the corresponding attribute table. The calculated deserialized attributes are assembled into the C++ object instance, and the deserialized attributes are divided into deserialized simple attributes and deserialized complex attributes according to the attribute type, and the deserialized attributes are placed in the corresponding attribute table. This method can reduce the problems of low reliability and easy omission of extensible markup language when the file structure changes, thereby improving conversion efficiency.
[0071] Example 3
[0072] like Figure 3 As shown, a method for converting between an extensible markup language and a C++ class comprises:
[0073] S310, register the C++ class and obtain the corresponding C++ object instance;
[0074] S320, determining a serialization attribute, wherein the serialization attribute is obtained by processing the C++ object instance according to QT; determining a deserialization attribute, wherein the deserialization attribute is obtained by processing the extensible markup language according to QT;
[0075] S330, traversing all the serialized attributes until all are processed;
[0076] S340, traverse all the deserialized attributes until all are processed.
[0077] The processing method of the serialization attribute and the deserialization attribute mentioned in Example 3 is only exemplary and is not a limitation on the processing of the serialization attribute and the deserialization attribute. After processing the serialization attribute and the deserialization attribute, the mutual conversion between the C++ class and the extensible markup language is realized. Such conversion can reduce the problems of low reliability and easy omission caused by the change of the file structure of the extensible markup language, thereby improving the conversion efficiency.
[0078] Example 4
[0079] like Figure 4 As shown, a device for converting between extensible markup language and C++ class, comprising:
[0080] The acquisition module 10 is used to register the C++ class and obtain the corresponding C++ object instance;
[0081] Processing module 20, used to determine serialization attributes, the serialization attributes are obtained by processing the C++ object instance according to QT; used to determine deserialization attributes, the deserialization attributes are obtained by processing the extensible markup language according to QT;
[0082] The output module 30 outputs the serialization attributes to a file in the format of the extensible markup language to implement the serialization process; and assembles the deserialization attributes of the file to the object instance to implement the deserialization process.
[0083] One implementation of the above-mentioned device may be: the acquisition module 10 acquires the object instance corresponding to the registered C++ class, the processing module 20 processes the C++ object instance according to QT to obtain the serialization attributes, and processes the extensible markup language according to QT to obtain the deserialization attributes. Finally, the output module 30 outputs the serialization attributes to the file in the format of the extensible markup language to implement the serialization process, and assembles the deserialization attributes in the file to the object instance to implement the deserialization process.
[0084] Example 5
[0085] like Figure 5 As shown, a processing module 20 of an apparatus for converting between an extensible markup language and a C++ class comprises:
[0086] A conversion unit 22, configured to obtain the serialization attribute from the C++ object instance;
[0087] The serialization attribute unit 24 divides the acquired serialization attributes into serialization simple attributes and serialization complex attributes according to the attribute type, and puts the serialization attributes into the corresponding attribute table;
[0088] An assembly unit 26, used for assembling the deserialized attributes into the C++ object instance;
[0089] The deserialization unit 28 is used to classify the obtained deserialized attributes into deserialized simple attributes and deserialized complex attributes according to the attribute type, and put the deserialized attributes into the corresponding attribute table.
[0090] An implementation mode of the processing module 20 of the above-mentioned device may be: the conversion unit 22 obtains serialization attributes from the C++ object instance, and then the serialization attribute unit 24 divides the serialization attributes into simple serialization attributes and complex serialization attributes, and puts the serialization attributes into the corresponding attribute table; the assembly unit 26 assembles the deserialization attributes into the C++ object instance, and then the deserialization unit 28 divides the deserialization attributes into simple deserialization attributes and complex deserialization attributes, and puts the deserialization attributes into the corresponding attribute table.
[0091] Example 6
[0092] like Figure 6 As shown, an acquisition module 10 of a device for converting between an extensible markup language and a C++ class comprises:
[0093] A registration unit 12, used for registering a C++ class;
[0094] The acquisition unit 14 is used to acquire the corresponding C++ object instance.
[0095] An implementation of the acquisition module 10 of the above device may be: the registration unit 12 is used to register a C++ class, and then the acquisition unit 14 acquires a C++ object instance corresponding to the registered C++ class.
[0096] Example 7
[0097] like Figure 7 As shown, an output module 30 of an apparatus for converting between an extensible markup language and a C++ class comprises:
[0098] A serialization output module 32, used for outputting the serialization attributes to a file in the format of the extensible markup language to implement a serialization process;
[0099] The deserialization output module 34 is used to assemble the deserialization attributes of the file into the object instance to implement the deserialization process.
[0100] An implementation of the output module 30 of the above-mentioned device may be: after obtaining the serialization attributes and the deserialization attributes, the serialization output module 32 outputs the serialization attributes to a file in the format of an extensible markup language to implement the serialization process, and the deserialization output module 34 assembles the deserialization attributes of the file to the object instance to implement the deserialization process.
[0101] Example 8
[0102] like Figure 8 As shown, an electronic device includes a memory 501 and a processor 502, wherein the memory 501 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 502 to implement the above-mentioned method of converting between extensible markup language and C++ class.
[0103] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0104] A computer-readable storage medium storing a computer program, wherein the computer program enables a computer to implement the above-mentioned method of converting between an extensible markup language and a C++ class when the computer executes the program.
[0105] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 501, and executed by the processor 502 to complete the present invention. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in a computer device.
[0106] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may include, but is not limited to, a memory 501 and a processor 502. Those skilled in the art will appreciate that this embodiment is merely an example of a computer device and does not constitute a limitation on the computer device, and may include more or fewer components, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0107] The processor 502 may be a central processing unit (CPU), or other general-purpose processors 502, digital signal processors 502 (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor 502 may be a microprocessor 502 or the processor 502 may be any conventional processor 502, etc.
[0108] The memory 501 may be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. The memory 501 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), etc. equipped on the computer device. Further, the memory 501 may also include both an internal storage unit of the computer device and an external storage device. The memory 501 is used to store computer programs and other programs and data required by the computer device. The memory 501 may also be used to temporarily store data that has been output or is to be output.
[0109] Example 9
[0110] like Fig. 9 As shown, a specific implementation may be:
[0111] s610. Register the C++ class required by the extensible language during serialization and obtain the corresponding C++ object instance;
[0112] The extensible language includes XML files, and all C++ classes needed by the XML files are registered so as to generate corresponding C++ object instances according to the class names.
[0113] s620, get serialization attributes;
[0114] The serialized attributes are obtained by processing the C++ object instance according to QT, and the obtained serialized attributes are divided into simple attributes and complex attributes according to their types;
[0115] s630, determine the serialization attribute, and output the serialization attribute to the XML file;
[0116] Use the QT to obtain all the QMetaProperty objects of the C++ object instance, and determine whether the serialized attribute is a simple attribute or a complex attribute. If the attribute is a simple attribute, <name> value< / name> In the form of, serialize the properties of the object instance into an XML file, traverse all properties until all properties are processed; if the property is a composite property, obtain all property QMetaProperty objects of the C++ object instance, for List properties, traverse and output all object instances in the List to an XML file; for Map properties, output all key-value pairs in the Map property to an XML file; for data structures that do not use List properties and Map properties, output the XML content in a one-by-one manner, for example:
[0117] <parent_property_name><property_name1> property_value< / property_name1><property_name2> property_value< / property_name2>< / parent_property_name> ;
[0118] If the data structure of List and Map attributes stores a composite type, the XML content is also output one by one.
[0119] s640, during the deserialization process, registering the C++ class to which the XML file outputted during the serialization process is applied into a hash table, and querying the hash table to return an object instance of the C++ class;
[0120] Use the Q_PROPERTY of QT to define the properties that need to be XMLized, use the C++ generic programming method to register the C++ class name into the global hash table, and template a C++ class instance generation function; the hash table uses the C++ class name as the key name, and the function pointer of the C++ class instance generation method as the key value; query the hash table according to the given string name, and call the function generated by the C++ class instance if the key value exists, and return the C++ class object instance;
[0121] s650, determine the deserialization attributes, and assemble the deserialization attributes into the C++ object instance;
[0122] Deserialized attributes include XML nodes or attributes, obtaining the text value of the XML node or attribute, checking whether the C++ class instance object has a corresponding simple attribute with the name of the XML node or attribute, and instantiating the child node or attribute into a C++ object instance according to the structure of the XML, and then assembling the object instance into the C++ object instance of the parent node;
[0123] If it is a simple attribute, a simple attribute means that the value of the attribute is a simple type, such as a string, integer, floating point, etc., use the QMetaProperty object to convert the text value of the XML node or attribute into the value of the corresponding attribute and assign it to the C++ object instance;
[0124] If it is a composite attribute, the composite attribute graph indicates that the value of the attribute is not a simple type, but a collection of one or more simple type attributes. The composite attribute assignment function is called to assign values to the simple objects in the composite attribute object. If it is a List data structure type, the child nodes with the same name under the same node can be automatically assembled into the List object; if it is a Map data structure type, the child nodes with the same name contained under the Map node under the same node can be saved in the Map object in a key-value manner; if it is not a List, Map or other data structure type, an instance of a C++ object is generated according to the name of the child node and the instance is assembled. Processing continues until all child nodes are processed.
[0125] Through the above process, an XML file can be put into a C++ object with a parent-child hierarchy.
[0126] The above description is only a specific embodiment of the present invention, but the technical features of the present invention are not limited thereto. Any changes or modifications made by any technician in the field of the present invention are included in the patent scope of the present invention.
Claims
1. A method for converting between an extensible markup language and a C++ class, characterized in that: The following steps are involved: Register the C++ class and obtain the corresponding C++ object instance; Determine a serialization attribute, the serialization attribute is obtained by processing the C++ object instance according to QT; determine a deserialization attribute, the deserialization attribute is obtained by processing the extensible markup language according to QT; Outputting the serialization attributes to a file in the format of the extensible markup language to realize the serialization process; assembling the deserialization attributes of the file to the object instance to realize the deserialization process; The serialization attribute is obtained according to QT processing the C++ object instance, including: Obtain the serialization attribute according to the C++ object instance, The obtained serialized attributes are divided into serialized simple attributes and serialized complex attributes according to the attribute type, and the serialized attributes are put into the corresponding attribute table; The deserialized attributes are obtained according to the QT processing extensible markup language, including: Assembling the deserialized attributes into the C++ object instance, The obtained deserialized attributes are divided into deserialized simple attributes and deserialized complex attributes according to the attribute type, and the deserialized attributes are put into the corresponding attribute table; The registering of the C++ class and obtaining the corresponding C++ object instance includes: Register the class name of the C++ class into the data structure using a standard container to generate a key-value pair; Template a generation function for the class instance of the C++ class using a standard container; According to the deserialization attribute, the data structure is queried whether there is a corresponding key-value pair. If so, the generation function is called to return the C++ object instance.
2. A method for converting between extensible markup language and C++ class according to claim 1, characterized in that: The process of outputting the serialization attributes to a file in the format of the extensible markup language to realize serialization includes: Traverse all the serialized attributes until all are processed; The process of assembling the deserialization attribute of the file to the object instance to realize deserialization includes: All of the deserialized attributes are traversed until all are processed.
3. A device for converting between extensible markup language and C++ classes, characterized in that: include: Get module, used to register C++ class and get corresponding C++ object instance; A processing module, used for determining serialization attributes, the serialization attributes are obtained by processing the C++ object instance according to QT; used for determining deserialization attributes, the deserialization attributes are obtained by processing the extensible markup language according to QT; An output module, outputting the serialization attributes to a file in the format of the extensible markup language to implement a serialization process; Assembling the deserialization attributes of the file to the object instance to implement deserialization; The processing module comprises: A conversion unit, used for obtaining the serialization attribute from the C++ object instance; A serialization attribute unit, which divides the acquired serialization attributes into serialization simple attributes and serialization complex attributes according to the attribute type, and puts the serialization attributes into a corresponding attribute table; An assembly unit, used for assembling the deserialized attribute into the C++ object instance; A deserialization unit, used for dividing the obtained deserialized attributes into deserialized simple attributes and deserialized complex attributes according to the attribute type, and putting the deserialized attributes into the corresponding attribute table; The acquisition module comprises: Registration unit, used to register C++ classes; The acquisition unit is used to obtain the corresponding C++ object instance.
4. The device for converting between Extensible Markup Language and C++ class according to claim 3, characterized in that: The output module comprises: A serialization output module, used for outputting the serialization attributes into a file in the format of the extensible markup language to implement the serialization process; The deserialization output module is used to assemble the deserialization attributes of the file into the object instance to realize the deserialization process.
5. An electronic device, characterized in that: It comprises a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement a method for converting between extensible markup language and C++ class as described in claim 1 or 2.
6. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables a computer to implement a method for converting between extensible markup language and C++ class as claimed in claim 1 or 2 when executed.
Citation Information
Patent Citations
Universal object serialization realizing method
CN103019689A
Code conversion method and device
CN104267935A