Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include <xmlstorage.h>
00043 using namespace XMLStorage;
00044
00045 #include <iostream>
00046 using namespace std;
00047
00048
00049 void test_writer()
00050 {
00051 XMLWriter wr("writertest.xml");
00052
00053 wr.create("root");
00054
00055 wr.create("example1");
00056 wr.create("PARAMS");
00057 wr.create("TEXT");
00058 wr.set_content("Testgruppe");
00059 wr.back();
00060
00061 wr.create("COLOR");
00062 wr.create("RED");
00063 wr.set_content("234");
00064 wr.back();
00065
00066 wr.create("GREEN");
00067 wr.set_content("22");
00068 wr.back();
00069
00070 wr.create("BLUE");
00071 wr.set_content("33");
00072 wr.back();
00073 wr.back();
00074
00075 wr.create("FONT");
00076 wr.create("FONT_FILENAME");
00077 wr.set_content("Arial.ttf");
00078 wr.back();
00079
00080 wr.create("SIZE");
00081 wr.set_content("12");
00082 wr.back();
00083 wr.back();
00084 wr.back();
00085 wr.back();
00086
00087 wr.create("example2");
00088 wr.create("PARAMS");
00089 wr["text"] = "Testgruppe";
00090
00091 wr.create("COLOR");
00092 wr["red"] = XMLInt(234);
00093 wr["green"] = XMLInt(22);
00094 wr["blue"] = XMLInt(33);
00095 wr.back();
00096
00097 wr.create("FONT");
00098 wr["font_filename"] = "Arial.ttf";
00099 wr["size"] = XMLInt(12);
00100 wr.back();
00101 wr.back();
00102 wr.back();
00103
00104 wr.create("example3");
00105 wr.create("Y_ACHSE");
00106 wr["Stopbits"] = XMLInt(1);
00107 wr["Parity"] = "N";
00108 wr.back();
00109 wr.back();
00110
00111 wr.back();
00112 }
00113
00114
00115 int main()
00116 {
00117 test_writer();
00118
00119 return 0;
00120 }