Rudiments

- Main Page
- Classes

xmldomnode.h
1 // Copyright (c) 2002 David Muse
2 // See the COPYING file for more information.
3
4 #ifndef RUDIMENTS_XMLDOMNODE_H
5 #define RUDIMENTS_XMLDOMNODE_H
6
7 #include <rudiments/private/xmldomnodeincludes.h>
8
9 enum xmldomnodetype {
10 NULL_XMLDOMNODETYPE=0,
11 ROOT_XMLDOMNODETYPE,
12 TAG_XMLDOMNODETYPE,
13 ATTRIBUTE_XMLDOMNODETYPE,
14 TEXT_XMLDOMNODETYPE,
15 COMMENT_XMLDOMNODETYPE,
16 CDATA_XMLDOMNODETYPE
17 };
18
19 class xmldom;
20 class xmldomnodeprivate;
21
123 class RUDIMENTS_DLLSPEC xmldomnode {
124 public:
140 xmldomnode(xmldom *dom, xmldomnode *nullnode);
141
145 xmldomnode(xmldom *dom,
146 xmldomnode *nullnode,
147 xmldomnodetype type,
148 const char *name,
149 const char *value);
150
154 xmldomnode(xmldom *dom,
155 xmldomnode *nullnode,
156 xmldomnodetype type,
157 const char *ns,
158 const char *name,
159 const char *value);
160
163 ~xmldomnode();
164
165
174 static xmldomnode *createNullNode(xmldom *dom);
175
176
179 void cascadeOnDelete();
180
184 void dontCascadeOnDelete();
185
186
188 xmldomnodetype getType() const;
189
191 const char *getNamespace() const;
192
194 const char *getName() const;
195
197 const char *getValue() const;
198
199
202 xmldom *getTree() const;
203
206 xmldomnode *getParent() const;
207
210 uint64_t getPosition() const;
211
214 xmldomnode *getPreviousSibling() const;
215
219 xmldomnode *getPreviousTagSibling() const;
220
224 xmldomnode *getPreviousTagSibling(const char *name) const;
225
229 xmldomnode *getPreviousTagSibling(
230 const char *ns,
231 const char *name) const;
232
236 xmldomnode *getPreviousTagSiblingIgnoringCase(
237 const char *name) const;
238
242 xmldomnode *getPreviousTagSiblingIgnoringCase(
243 const char *ns,
244 const char *name) const;
245
255 xmldomnode *getPreviousTagSibling(
256 const char *name,
257 const char *attributename,
258 const char *attributevalue) const;
259
269 xmldomnode *getPreviousTagSibling(
270 const char *ns,
271 const char *name,
272 const char *attributename,
273 const char *attributevalue) const;
274
283 xmldomnode *getPreviousTagSiblingIgnoringCase(
284 const char *name,
285 const char *attributename,
286 const char *attributevalue) const;
287
297 xmldomnode *getPreviousTagSiblingIgnoringCase(
298 const char *ns,
299 const char *name,
300 const char *attributename,
301 const char *attributevalue) const;
302
305 xmldomnode *getNextSibling() const;
306
310 xmldomnode *getNextTagSibling() const;
311
315 xmldomnode *getNextTagSibling(const char *name) const;
316
320 xmldomnode *getNextTagSibling(const char *ns,
321 const char *name) const;
322
326 xmldomnode *getNextTagSiblingIgnoringCase(
327 const char *name) const;
328
332 xmldomnode *getNextTagSiblingIgnoringCase(
333 const char *ns,
334 const char *name) const;
335
345 xmldomnode *getNextTagSibling(
346 const char *name,
347 const char *attributename,
348 const char *attributevalue) const;
349
358 xmldomnode *getNextTagSibling(
359 const char *ns,
360 const char *name,
361 const char *attributename,
362 const char *attributevalue) const;
363
372 xmldomnode *getNextTagSiblingIgnoringCase(
373 const char *name,
374 const char *attributename,
375 const char *attributevalue) const;
376
385 xmldomnode *getNextTagSiblingIgnoringCase(
386 const char *ns,
387 const char *name,
388 const char *attributename,
389 const char *attributevalue) const;
390
395 xmldomnode *getNextTagSiblingInSet(
396 const char * const *set) const;
397
403 xmldomnode *getNextTagSiblingInSet(
404 const char *ns,
405 const char * const *set) const;
406
407
409 uint64_t getChildCount() const;
410
413 xmldomnode *getFirstChild(const char *name) const;
414
417 xmldomnode *getFirstChild(const char *ns,
418 const char *name) const;
419
422 xmldomnode *getFirstChildIgnoringCase(
423 const char *name) const;
424
428 xmldomnode *getFirstChildIgnoringCase(
429 const char *ns,
430 const char *name) const;
431
434 xmldomnode *getChild(uint64_t position) const;
435
444 xmldomnode *getFirstChild(const char *name,
445 const char *attributename,
446 const char *attributevalue)
447 const;
448
457 xmldomnode *getFirstChild(const char *ns,
458 const char *name,
459 const char *attributename,
460 const char *attributevalue)
461 const;
462
471 xmldomnode *getFirstChildIgnoringCase(
472 const char *name,
473 const char *attributename,
474 const char *attributevalue)
475 const;
476
484 xmldomnode *getFirstChildIgnoringCase(
485 const char *ns,
486 const char *name,
487 const char *attributename,
488 const char *attributevalue)
489 const;
490
494 xmldomnode *getFirstTagChild() const;
495
499 xmldomnode *getFirstTagChild(const char *name) const;
500
504 xmldomnode *getFirstTagChild(const char *ns,
505 const char *name) const;
506
510 xmldomnode *getFirstTagChildIgnoringCase(
511 const char *name) const;
512
517 xmldomnode *getFirstTagChildIgnoringCase(
518 const char *ns,
519 const char *name) const;
520
530 xmldomnode *getFirstTagChild(
531 const char *name,
532 const char *attributename,
533 const char *attributevalue) const;
534
542 xmldomnode *getFirstTagChild(
543 const char *ns,
544 const char *name,
545 const char *attributename,
546 const char *attributevalue) const;
547
556 xmldomnode *getFirstTagChildIgnoringCase(
557 const char *name,
558 const char *attributename,
559 const char *attributevalue) const;
560
569 xmldomnode *getFirstTagChildIgnoringCase(
570 const char *ns,
571 const char *name,
572 const char *attributename,
573 const char *attributevalue) const;
574
579 xmldomnode *getFirstTagChildInSet(
580 const char * const *set) const;
581
587 xmldomnode *getFirstTagChildInSet(
588 const char *ns,
589 const char * const *set) const;
590
591
595 xmldomnode *getFirstTagDescendent(const char *name) const;
596
597
601 xmldomnode *getFirstTagDescendent(
602 const char *ns,
603 const char *name) const;
604
605
609 xmldomnode *getFirstTagDescendentIgnoringCase(
610 const char *name) const;
611
612
617 xmldomnode *getFirstTagDescendentIgnoringCase(
618 const char *ns,
619 const char *name) const;
620
630 xmldomnode *getFirstTagDescendent(
631 const char *name,
632 const char *attributename,
633 const char *attributevalue) const;
634
642 xmldomnode *getFirstTagDescendent(
643 const char *ns,
644 const char *name,
645 const char *attributename,
646 const char *attributevalue) const;
647
656 xmldomnode *getFirstTagDescendentIgnoringCase(
657 const char *name,
658 const char *attributename,
659 const char *attributevalue) const;
660
669 xmldomnode *getFirstTagDescendentIgnoringCase(
670 const char *ns,
671 const char *name,
672 const char *attributename,
673 const char *attributevalue) const;
674
679 xmldomnode *getFirstTagDescendentInSet(
680 const char * const *set) const;
681
686 xmldomnode *getFirstTagDescendentInSet(
687 const char *ns,
688 const char * const *set) const;
689
692 xmldomnode *getNextTag() const;
693
699 xmldomnode *getNextTag(xmldomnode *top) const;
700
703 xmldomnode *getPreviousTag() const;
704
710 xmldomnode *getPreviousTag(xmldomnode *top) const;
711
712
714 uint64_t getAttributeCount() const;
715
718 xmldomnode *getAttribute(const char *name) const;
719
722 xmldomnode *getAttributeIgnoringCase(
723 const char *name) const;
724
727 xmldomnode *getAttribute(uint64_t position) const;
728
731 const char *getAttributeValue(const char *name) const;
732
736 const char *getAttributeValue(uint64_t position) const;
737
745 constnamevaluepairs *getAttributes() const;
746
750 void setAttributeValue(const char *name,
751 const char *value);
752
756 void setAttributeValue(const char *name,
757 int64_t value);
758
762 void setAttributeValue(const char *name,
763 uint64_t value);
764
766 xmldomnode *getNullNode() const;
767
770 bool isNullNode() const;
771
772
774 void setType(xmldomnodetype type);
775
777 void setNamespace(const char *ns);
778
780 void setName(const char *name);
781
783 void setName(const char *ns, const char *name);
784
786 void setValue(const char *value);
787
789 void setParent(xmldomnode *parent);
790
792 void setPreviousSibling(xmldomnode *previous);
793
795 void setNextSibling(xmldomnode *next);
796
800 bool insertChild(xmldomnode *child, uint64_t position);
801
803 bool appendChild(xmldomnode *child);
804
812 xmldomnode *insertTag(const char *tag, uint64_t position);
813
821 xmldomnode *insertTag(const char *ns,
822 const char *tag,
823 uint64_t position);
824
830 bool insertXml(const char *xml, uint64_t position);
831
838 bool insertXmlFile(const char *xmlfile, uint64_t position);
839
845 xmldomnode *appendTag(const char *tag);
846
852 xmldomnode *appendTag(const char *ns, const char *tag);
853
858 bool appendXml(const char *xml);
859
864 bool appendXmlFile(const char *xmlfile);
865
871 bool moveChild(xmldomnode *child,
872 xmldomnode *parent, uint64_t position);
873
877 bool deleteChild(uint64_t position);
878
884 bool deleteChild(xmldomnode *child);
885
889 bool deleteFirstChild(const char *name);
890
894 bool deleteFirstChild(const char *ns, const char *name);
895
899 bool deleteFirstChildIgnoringCase(const char *name);
900
904 bool deleteFirstChildIgnoringCase(const char *ns,
905 const char *name);
906
916 bool deleteFirstChild(const char *name,
917 const char *attributename,
918 const char *attributevalue);
919
929 bool deleteFirstChild(const char *ns,
930 const char *name,
931 const char *attributename,
932 const char *attributevalue);
933
942 bool deleteFirstChildIgnoringCase(
943 const char *name,
944 const char *attributename,
945 const char *attributevalue);
946
955 bool deleteFirstChildIgnoringCase(
956 const char *ns,
957 const char *name,
958 const char *attributename,
959 const char *attributevalue);
960
962 bool deleteChildren();
963
965 bool deleteChildren(const char *name);
966
969 bool deleteChildren(const char *ns, const char *name);
970
972 bool deleteChildrenIgnoringCase(const char *name);
973
976 bool deleteChildrenIgnoringCase(const char *ns,
977 const char *name);
978
988 bool deleteChildren(const char *name,
989 const char *attributename,
990 const char *attributevalue);
991
1001 bool deleteChildren(const char *ns,
1002 const char *name,
1003 const char *attributename,
1004 const char *attributevalue);
1005
1014 bool deleteChildrenIgnoringCase(
1015 const char *name,
1016 const char *attributename,
1017 const char *attributevalue);
1018
1027 bool deleteChildrenIgnoringCase(
1028 const char *ns,
1029 const char *name,
1030 const char *attributename,
1031 const char *attributevalue);
1032
1034 bool deleteDescendents(const char *name);
1035
1038 bool deleteDescendents(const char *ns,
1039 const char *name);
1040
1042 bool deleteDescendentsIgnoringCase(const char *name);
1043
1046 bool deleteDescendentsIgnoringCase(const char *ns,
1047 const char *name);
1048
1058 bool deleteDescendents(const char *name,
1059 const char *attributename,
1060 const char *attributevalue);
1061
1071 bool deleteDescendents(const char *ns,
1072 const char *name,
1073 const char *attributename,
1074 const char *attributevalue);
1075
1084 bool deleteDescendentsIgnoringCase(
1085 const char *name,
1086 const char *attributename,
1087 const char *attributevalue);
1088
1097 bool deleteDescendentsIgnoringCase(
1098 const char *ns,
1099 const char *name,
1100 const char *attributename,
1101 const char *attributevalue);
1102
1103
1106 bool renameFirstChild(const char *oldname,
1107 const char *newname);
1108
1109
1112 bool renameFirstChild(const char *oldns,
1113 const char *oldname,
1114 const char *newns,
1115 const char *newname);
1116
1119 bool renameFirstChildIgnoringCase(const char *oldname,
1120 const char *newname);
1121
1125 bool renameFirstChildIgnoringCase(const char *oldns,
1126 const char *oldname,
1127 const char *newns,
1128 const char *newname);
1129
1132 bool renameChildren(const char *oldname,
1133 const char *newname);
1134
1137 bool renameChildren(const char *oldns,
1138 const char *oldname,
1139 const char *newns,
1140 const char *newname);
1141
1144 bool renameChildrenIgnoringCase(const char *oldname,
1145 const char *newname);
1146
1150 bool renameChildrenIgnoringCase(const char *oldns,
1151 const char *oldname,
1152 const char *newns,
1153 const char *newname);
1154
1157 bool renameDescendents(const char *oldname,
1158 const char *newname);
1159
1162 bool renameDescendents(const char *oldns,
1163 const char *oldname,
1164 const char *newns,
1165 const char *newname);
1166
1169 bool renameDescendentsIgnoringCase(
1170 const char *oldname,
1171 const char *newname);
1172
1176 bool renameDescendentsIgnoringCase(
1177 const char *oldns,
1178 const char *oldname,
1179 const char *newns,
1180 const char *newname);
1181
1182
1187 bool insertText(const char *value, uint64_t position);
1188
1191 bool appendText(const char *value);
1192
1196 bool insertAttribute(xmldomnode *attribute,
1197 uint64_t position);
1198
1200 bool appendAttribute(xmldomnode *attribute);
1201
1206 bool insertAttribute(const char *name, const char *value,
1207 uint64_t position);
1208
1211 bool appendAttribute(const char *name, const char *value);
1212
1216 bool deleteAttribute(uint64_t position);
1217
1222 bool deleteAttribute(const char *name);
1223
1227 bool deleteAttribute(xmldomnode *attribute);
1228
1229
1235 bool unwrapChild(xmldomnode *child);
1236
1239 bool unwrapFirstChild(const char *name);
1240
1243 bool unwrapFirstChild(const char *ns, const char *name);
1244
1247 bool unwrapFirstChildIgnoringCase(const char *name);
1248
1252 bool unwrapFirstChildIgnoringCase(const char *ns,
1253 const char *name);
1254
1257 bool unwrapChildren(const char *name);
1258
1261 bool unwrapChildren(const char *ns, const char *name);
1262
1265 bool unwrapChildrenIgnoringCase(const char *name);
1266
1270 bool unwrapChildrenIgnoringCase(const char *ns,
1271 const char *name);
1272
1275 bool unwrapDescendents(const char *name);
1276
1279 bool unwrapDescendents(const char *ns, const char *name);
1280
1283 bool unwrapDescendentsIgnoringCase(const char *name);
1284
1288 bool unwrapDescendentsIgnoringCase(const char *ns,
1289 const char *name);
1290
1291
1297 xmldomnode *wrapChild(xmldomnode *child,
1298 const char *name);
1299
1306 xmldomnode *wrapChild(xmldomnode *child,
1307 const char *ns,
1308 const char *name);
1309
1318 xmldomnode *wrapChildren(xmldomnode *startchild,
1319 xmldomnode *endchild,
1320 const char *name);
1321
1331 xmldomnode *wrapChildren(xmldomnode *startchild,
1332 xmldomnode *endchild,
1333 const char *ns,
1334 const char *name);
1335
1338 xmldomnode *wrapChildren(const char *name);
1339
1343 xmldomnode *wrapChildren(const char *ns, const char *name);
1344
1345
1348 xmldomnode *clone();
1349
1352 xmldomnode *clone(xmldom *dom);
1353
1354
1360 stringbuffer *xml() const;
1361
1364 void print(stringbuffer *strb) const;
1365
1368 void print(filedescriptor *fd) const;
1369
1379 stringbuffer *getPath() const;
1380
1387 xmldomnode *getChildByPath(const char *path) const;
1388
1397 xmldomnode *getAttributeByPath(const char *path,
1398 uint64_t position) const;
1399
1407 xmldomnode *getAttributeByPath(const char *path,
1408 const char *name) const;
1409
1418 const char *getAttributeValueByPath(const char *path,
1419 uint64_t position) const;
1420
1429 const char *getAttributeValueByPath(const char *path,
1430 const char *name) const;
1431
1433 void setData(void *data);
1434
1437 void *getData();
1438
1439 #include <rudiments/private/xmldomnode.h>
1440 };
1441
1442 #endif
xmldomnode
Definition: xmldomnode.h:123
stringbuffer
Definition: stringbuffer.h:22
filedescriptor
Definition: filedescriptor.h:14
xmldom
Definition: xmldom.h:12