Rudiments
domnode.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4#ifndef RUDIMENTS_DOMNODE_H
5#define RUDIMENTS_DOMNODE_H
6
7#include <rudiments/private/domnodeincludes.h>
8
9enum domnodetype {
10 NULL_DOMNODETYPE=0,
11 ROOT_DOMNODETYPE,
12 TAG_DOMNODETYPE,
13 ATTRIBUTE_DOMNODETYPE,
14 TEXT_DOMNODETYPE,
15 COMMENT_DOMNODETYPE,
16 CDATA_DOMNODETYPE
17};
18
19class dom;
20
122class RUDIMENTS_DLLSPEC domnode : virtual public object {
123 public:
140
144 domnode(dom *dom, domnodetype type,
145 const char *name,
146 const char *value);
147
151 domnode(dom *dom, domnodetype type,
152 const char *ns,
153 const char *name,
154 const char *value);
155
158 virtual ~domnode();
159
160
170
171
173 virtual domnodetype getType();
174
176 virtual const char *getNamespace();
177
179 virtual const char *getName();
180
182 virtual const char *getValue();
183
184
188
191 virtual domnode *getParent();
192
195 virtual uint64_t getPosition();
196
200
205
209 domnode *getPreviousTagSibling(const char *name);
210
215 const char *name);
216
221 const char *name);
222
227 const char *ns,
228 const char *name);
229
240 const char *name,
241 const char *attributename,
242 const char *attributevalue);
243
254 const char *ns,
255 const char *name,
256 const char *attributename,
257 const char *attributevalue);
258
268 const char *name,
269 const char *attributename,
270 const char *attributevalue);
271
282 const char *ns,
283 const char *name,
284 const char *attributename,
285 const char *attributevalue);
286
290
295
299 domnode *getNextTagSibling(const char *name);
300
304 domnode *getNextTagSibling(const char *ns,
305 const char *name);
306
311 const char *name);
312
317 const char *ns,
318 const char *name);
319
330 const char *name,
331 const char *attributename,
332 const char *attributevalue);
333
343 const char *ns,
344 const char *name,
345 const char *attributename,
346 const char *attributevalue);
347
357 const char *name,
358 const char *attributename,
359 const char *attributevalue);
360
370 const char *ns,
371 const char *name,
372 const char *attributename,
373 const char *attributevalue);
374
380 const char * const *set);
381
388 const char *ns,
389 const char * const *set);
390
391
393 virtual uint64_t getChildCount();
394
398
401 domnode *getFirstChild(const char *name);
402
405 domnode *getFirstChild(const char *ns,
406 const char *name);
407
411 const char *name);
412
417 const char *ns,
418 const char *name);
419
422 domnode *getChild(uint64_t position);
423
432 domnode *getFirstChild(const char *name,
433 const char *attributename,
434 const char *attributevalue);
435
444 domnode *getFirstChild(const char *ns,
445 const char *name,
446 const char *attributename,
447 const char *attributevalue);
448
458 const char *name,
459 const char *attributename,
460 const char *attributevalue);
461
470 const char *ns,
471 const char *name,
472 const char *attributename,
473 const char *attributevalue);
474
479
483 domnode *getFirstTagChild(const char *name);
484
488 domnode *getFirstTagChild(const char *ns,
489 const char *name);
490
495 const char *name);
496
502 const char *ns,
503 const char *name);
504
515 const char *name,
516 const char *attributename,
517 const char *attributevalue);
518
527 const char *ns,
528 const char *name,
529 const char *attributename,
530 const char *attributevalue);
531
541 const char *name,
542 const char *attributename,
543 const char *attributevalue);
544
554 const char *ns,
555 const char *name,
556 const char *attributename,
557 const char *attributevalue);
558
564 const char * const *set);
565
572 const char *ns,
573 const char * const *set);
574
575
579 domnode *getFirstTagDescendent(const char *name);
580
581
586 const char *ns,
587 const char *name);
588
589
594 const char *name);
595
596
602 const char *ns,
603 const char *name);
604
615 const char *name,
616 const char *attributename,
617 const char *attributevalue);
618
627 const char *ns,
628 const char *name,
629 const char *attributename,
630 const char *attributevalue);
631
641 const char *name,
642 const char *attributename,
643 const char *attributevalue);
644
654 const char *ns,
655 const char *name,
656 const char *attributename,
657 const char *attributevalue);
658
664 const char * const *set);
665
671 const char *ns,
672 const char * const *set);
673
677
684
688
695
696
698 virtual uint64_t getAttributeCount();
699
702 virtual domnode *getAttribute(const char *name);
703
707 const char *name);
708
711 virtual domnode *getAttribute(uint64_t position);
712
715 const char *getAttributeValue(const char *name);
716
720 const char *getAttributeValue(uint64_t position);
721
729
733 void setAttributeValue(const char *name, const char *value);
734
738 void setAttributeValue(const char *name, int64_t value);
739
743 void setAttributeValue(const char *name, uint64_t value);
744
747
750 virtual bool isNullNode();
751
752
754 virtual void setType(domnodetype type);
755
757 virtual void setNamespace(const char *ns);
758
760 virtual void setName(const char *name);
761
763 void setName(const char *ns, const char *name);
764
766 virtual void setValue(const char *value);
767
769 virtual void setParent(domnode *parent);
770
772 virtual void setPreviousSibling(domnode *previous);
773
775 virtual void setNextSibling(domnode *next);
776
780 bool insertChild(domnode *child, uint64_t position);
781
783 bool appendChild(domnode *child);
784
792 domnode *insertTag(const char *tag, uint64_t position);
793
801 domnode *insertTag(const char *ns,
802 const char *tag,
803 uint64_t position);
804
810 domnode *appendTag(const char *tag);
811
817 domnode *appendTag(const char *ns, const char *tag);
818
824 bool moveChild(domnode *child,
825 domnode *parent, uint64_t position);
826
830 bool deleteChild(uint64_t position);
831
837 bool deleteChild(domnode *child);
838
842 bool deleteFirstChild(const char *name);
843
847 bool deleteFirstChild(const char *ns, const char *name);
848
852 bool deleteFirstChildIgnoringCase(const char *name);
853
857 bool deleteFirstChildIgnoringCase(const char *ns,
858 const char *name);
859
869 bool deleteFirstChild(const char *name,
870 const char *attributename,
871 const char *attributevalue);
872
882 bool deleteFirstChild(const char *ns,
883 const char *name,
884 const char *attributename,
885 const char *attributevalue);
886
896 const char *name,
897 const char *attributename,
898 const char *attributevalue);
899
909 const char *ns,
910 const char *name,
911 const char *attributename,
912 const char *attributevalue);
913
916
918 bool deleteChildren(const char *name);
919
922 bool deleteChildren(const char *ns, const char *name);
923
925 bool deleteChildrenIgnoringCase(const char *name);
926
929 bool deleteChildrenIgnoringCase(const char *ns,
930 const char *name);
931
941 bool deleteChildren(const char *name,
942 const char *attributename,
943 const char *attributevalue);
944
954 bool deleteChildren(const char *ns,
955 const char *name,
956 const char *attributename,
957 const char *attributevalue);
958
968 const char *name,
969 const char *attributename,
970 const char *attributevalue);
971
981 const char *ns,
982 const char *name,
983 const char *attributename,
984 const char *attributevalue);
985
987 bool deleteDescendents(const char *name);
988
991 bool deleteDescendents(const char *ns,
992 const char *name);
993
995 bool deleteDescendentsIgnoringCase(const char *name);
996
999 bool deleteDescendentsIgnoringCase(const char *ns,
1000 const char *name);
1001
1011 bool deleteDescendents(const char *name,
1012 const char *attributename,
1013 const char *attributevalue);
1014
1024 bool deleteDescendents(const char *ns,
1025 const char *name,
1026 const char *attributename,
1027 const char *attributevalue);
1028
1038 const char *name,
1039 const char *attributename,
1040 const char *attributevalue);
1041
1051 const char *ns,
1052 const char *name,
1053 const char *attributename,
1054 const char *attributevalue);
1055
1056
1059 bool renameFirstChild(const char *oldname,
1060 const char *newname);
1061
1062
1065 bool renameFirstChild(const char *oldns,
1066 const char *oldname,
1067 const char *newns,
1068 const char *newname);
1069
1072 bool renameFirstChildIgnoringCase(const char *oldname,
1073 const char *newname);
1074
1078 bool renameFirstChildIgnoringCase(const char *oldns,
1079 const char *oldname,
1080 const char *newns,
1081 const char *newname);
1082
1085 bool renameChildren(const char *oldname,
1086 const char *newname);
1087
1090 bool renameChildren(const char *oldns,
1091 const char *oldname,
1092 const char *newns,
1093 const char *newname);
1094
1097 bool renameChildrenIgnoringCase(const char *oldname,
1098 const char *newname);
1099
1103 bool renameChildrenIgnoringCase(const char *oldns,
1104 const char *oldname,
1105 const char *newns,
1106 const char *newname);
1107
1110 bool renameDescendents(const char *oldname,
1111 const char *newname);
1112
1115 bool renameDescendents(const char *oldns,
1116 const char *oldname,
1117 const char *newns,
1118 const char *newname);
1119
1123 const char *oldname,
1124 const char *newname);
1125
1130 const char *oldns,
1131 const char *oldname,
1132 const char *newns,
1133 const char *newname);
1134
1135
1140 bool insertText(const char *value, uint64_t position);
1141
1144 bool appendText(const char *value);
1145
1149 bool insertAttribute(domnode *attribute,
1150 uint64_t position);
1151
1153 bool appendAttribute(domnode *attribute);
1154
1159 bool insertAttribute(const char *name, const char *value,
1160 uint64_t position);
1161
1164 bool appendAttribute(const char *name, const char *value);
1165
1169 bool deleteAttribute(uint64_t position);
1170
1175 bool deleteAttribute(const char *name);
1176
1180 bool deleteAttribute(domnode *attribute);
1181
1182
1188 bool unwrapChild(domnode *child);
1189
1192 bool unwrapFirstChild(const char *name);
1193
1196 bool unwrapFirstChild(const char *ns, const char *name);
1197
1200 bool unwrapFirstChildIgnoringCase(const char *name);
1201
1205 bool unwrapFirstChildIgnoringCase(const char *ns,
1206 const char *name);
1207
1210 bool unwrapChildren(const char *name);
1211
1214 bool unwrapChildren(const char *ns, const char *name);
1215
1218 bool unwrapChildrenIgnoringCase(const char *name);
1219
1223 bool unwrapChildrenIgnoringCase(const char *ns,
1224 const char *name);
1225
1228 bool unwrapDescendents(const char *name);
1229
1232 bool unwrapDescendents(const char *ns, const char *name);
1233
1236 bool unwrapDescendentsIgnoringCase(const char *name);
1237
1242 const char *name);
1243
1244
1251 const char *name);
1252
1260 const char *ns,
1261 const char *name);
1262
1272 domnode *endchild,
1273 const char *name);
1274
1285 domnode *endchild,
1286 const char *ns,
1287 const char *name);
1288
1291 domnode *wrapChildren(const char *name);
1292
1296 domnode *wrapChildren(const char *ns, const char *name);
1297
1298
1301 virtual domnode *clone();
1302
1305 virtual domnode *clone(dom *dom);
1306
1307
1310 ssize_t write();
1311
1318 ssize_t write(bool indent);
1319
1324 ssize_t write(output *out);
1325
1334 ssize_t write(output *out, bool indent);
1335
1338 ssize_t writeXml();
1339
1346 ssize_t writeXml(bool indent);
1347
1352 ssize_t writeXml(output *out);
1353
1362 ssize_t writeXml(output *out, bool indent);
1363
1374
1381 domnode *getChildByPath(const char *path);
1382
1391 domnode *getAttributeByPath(const char *path,
1392 uint64_t position);
1393
1401 domnode *getAttributeByPath(const char *path,
1402 const char *name);
1403
1412 const char *getAttributeValueByPath(const char *path,
1413 uint64_t position);
1414
1423 const char *getAttributeValueByPath(const char *path,
1424 const char *name);
1425
1427 void setData(void *data);
1428
1431 void *getData();
1432
1433 #include <rudiments/private/domnode.h>
1434};
1435
1436#endif
Definition dictionary.h:12
Definition dom.h:10
Definition domnode.h:122
bool deleteFirstChildIgnoringCase(const char *ns, const char *name, const char *attributename, const char *attributevalue)
domnode * getPreviousTagSibling(const char *name, const char *attributename, const char *attributevalue)
domnode * getFirstTagChildIgnoringCase(const char *ns, const char *name)
domnode * getNextTagSibling(const char *ns, const char *name)
bool deleteChildrenIgnoringCase(const char *name, const char *attributename, const char *attributevalue)
ssize_t writeXml()
domnode * getFirstChild(const char *ns, const char *name)
domnode * getPreviousTagSibling(const char *ns, const char *name)
dictionary< const char *, const char * > * getAttributes()
bool deleteDescendentsIgnoringCase(const char *ns, const char *name)
bool renameChildrenIgnoringCase(const char *oldname, const char *newname)
virtual domnode * getFirstChild()
domnode * getAttributeByPath(const char *path, const char *name)
domnode * getFirstTagChildIgnoringCase(const char *ns, const char *name, const char *attributename, const char *attributevalue)
domnode * getPreviousTagSibling()
bool renameDescendentsIgnoringCase(const char *oldname, const char *newname)
domnode * getFirstTagDescendent(const char *name, const char *attributename, const char *attributevalue)
virtual domnode * clone(dom *dom)
domnode * wrapChildren(const char *ns, const char *name)
domnode * getFirstChildIgnoringCase(const char *name)
bool appendChild(domnode *child)
bool renameDescendents(const char *oldns, const char *oldname, const char *newns, const char *newname)
domnode * getPreviousTagSibling(const char *ns, const char *name, const char *attributename, const char *attributevalue)
domnode * getPreviousTagSiblingIgnoringCase(const char *name, const char *attributename, const char *attributevalue)
domnode * getFirstTagChild(const char *ns, const char *name)
domnode * getFirstTagDescendentIgnoringCase(const char *ns, const char *name)
domnode * getFirstTagDescendentInSet(const char *const *set)
bool appendAttribute(domnode *attribute)
bool deleteAttribute(uint64_t position)
domnode * wrapChildren(domnode *startchild, domnode *endchild, const char *ns, const char *name)
domnode * insertTag(const char *ns, const char *tag, uint64_t position)
bool renameFirstChild(const char *oldns, const char *oldname, const char *newns, const char *newname)
domnode(dom *dom, domnodetype type, const char *name, const char *value)
domnode * getFirstTagDescendent(const char *ns, const char *name)
const char * getAttributeValueByPath(const char *path, const char *name)
domnode * getNextTagSiblingIgnoringCase(const char *name, const char *attributename, const char *attributevalue)
domnode * appendTag(const char *ns, const char *tag)
bool unwrapFirstChild(const char *ns, const char *name)
domnode * getPreviousTag(domnode *top)
domnode * getFirstTagDescendent(const char *name)
bool renameDescendents(const char *oldname, const char *newname)
virtual domnode * getParent()
ssize_t writeXml(bool indent)
virtual domnodetype getType()
domnode * getFirstTagChild(const char *ns, const char *name, const char *attributename, const char *attributevalue)
ssize_t write(bool indent)
bool renameChildren(const char *oldns, const char *oldname, const char *newns, const char *newname)
bool unwrapFirstChildIgnoringCase(const char *name)
virtual void setNamespace(const char *ns)
bool deleteDescendentsIgnoringCase(const char *name, const char *attributename, const char *attributevalue)
domnode * getPreviousTag()
bool deleteDescendentsIgnoringCase(const char *ns, const char *name, const char *attributename, const char *attributevalue)
bool unwrapDescendents(const char *ns, const char *name)
domnode * appendTag(const char *tag)
domnode * getFirstTagDescendentInSet(const char *ns, const char *const *set)
bool deleteChild(domnode *child)
bool renameChildren(const char *oldname, const char *newname)
domnode * getNextTagSiblingIgnoringCase(const char *ns, const char *name, const char *attributename, const char *attributevalue)
domnode * getFirstChild(const char *name)
bool deleteChildren(const char *ns, const char *name)
domnode * getPreviousTagSiblingIgnoringCase(const char *name)
domnode * getNullNode()
ssize_t writeXml(output *out)
bool deleteAttribute(const char *name)
virtual bool isNullNode()
domnode * getFirstTagDescendentIgnoringCase(const char *name, const char *attributename, const char *attributevalue)
bool deleteFirstChildIgnoringCase(const char *name)
domnode(dom *dom, domnodetype type, const char *ns, const char *name, const char *value)
bool renameFirstChild(const char *oldname, const char *newname)
dom * getTree()
domnode * getNextTagSibling(const char *ns, const char *name, const char *attributename, const char *attributevalue)
bool unwrapFirstChild(const char *name)
virtual void setPreviousSibling(domnode *previous)
virtual uint64_t getAttributeCount()
domnode * wrapChild(domnode *child, const char *ns, const char *name)
bool unwrapFirstChildIgnoringCase(const char *ns, const char *name)
bool deleteChildren(const char *name, const char *attributename, const char *attributevalue)
bool unwrapChildrenIgnoringCase(const char *ns, const char *name)
bool moveChild(domnode *child, domnode *parent, uint64_t position)
bool deleteDescendents(const char *name)
bool renameFirstChildIgnoringCase(const char *oldname, const char *newname)
virtual domnode * clone()
domnode * getFirstChild(const char *ns, const char *name, const char *attributename, const char *attributevalue)
domnode * getFirstTagChildInSet(const char *ns, const char *const *set)
void * getData()
bool deleteChildrenIgnoringCase(const char *name)
bool unwrapChild(domnode *child)
virtual domnode * getNextSibling()
bool deleteDescendentsIgnoringCase(const char *name)
bool renameFirstChildIgnoringCase(const char *oldns, const char *oldname, const char *newns, const char *newname)
domnode * getAttributeByPath(const char *path, uint64_t position)
domnode * getPreviousTagSibling(const char *name)
domnode * getNextTagSiblingInSet(const char *ns, const char *const *set)
virtual domnode * getAttributeIgnoringCase(const char *name)
virtual void setParent(domnode *parent)
stringbuffer * getPath()
bool deleteDescendents(const char *ns, const char *name)
domnode * getFirstChildIgnoringCase(const char *name, const char *attributename, const char *attributevalue)
ssize_t write(output *out)
virtual void setName(const char *name)
void setData(void *data)
domnode * getNextTagSiblingIgnoringCase(const char *ns, const char *name)
ssize_t write(output *out, bool indent)
virtual domnode * getAttribute(const char *name)
bool appendText(const char *value)
bool deleteFirstChild(const char *name)
domnode * getNextTagSibling(const char *name)
bool deleteChildrenIgnoringCase(const char *ns, const char *name, const char *attributename, const char *attributevalue)
domnode * wrapChild(domnode *child, const char *name)
void setAttributeValue(const char *name, int64_t value)
bool insertAttribute(const char *name, const char *value, uint64_t position)
domnode * getNextTagSiblingInSet(const char *const *set)
domnode * getFirstChild(const char *name, const char *attributename, const char *attributevalue)
bool appendAttribute(const char *name, const char *value)
domnode * getPreviousTagSiblingIgnoringCase(const char *ns, const char *name)
bool deleteDescendents(const char *name, const char *attributename, const char *attributevalue)
domnode * getChildByPath(const char *path)
virtual void setType(domnodetype type)
bool renameDescendentsIgnoringCase(const char *oldns, const char *oldname, const char *newns, const char *newname)
bool deleteChildrenIgnoringCase(const char *ns, const char *name)
domnode * insertTag(const char *tag, uint64_t position)
domnode * getFirstChildIgnoringCase(const char *ns, const char *name, const char *attributename, const char *attributevalue)
domnode * getChild(uint64_t position)
bool unwrapChildren(const char *name)
domnode * getFirstTagDescendent(const char *ns, const char *name, const char *attributename, const char *attributevalue)
domnode * wrapChildren(const char *name)
domnode * getNextTagSibling()
bool unwrapDescendentsIgnoringCase(const char *ns, const char *name)
domnode * getNextTagSibling(const char *name, const char *attributename, const char *attributevalue)
bool renameChildrenIgnoringCase(const char *oldns, const char *oldname, const char *newns, const char *newname)
bool insertText(const char *value, uint64_t position)
virtual const char * getNamespace()
virtual ~domnode()
bool deleteFirstChildIgnoringCase(const char *ns, const char *name)
virtual void setValue(const char *value)
virtual const char * getName()
bool deleteFirstChild(const char *ns, const char *name, const char *attributename, const char *attributevalue)
static domnode * createNullNode(dom *dom)
bool deleteChildren(const char *name)
domnode * getFirstTagChildIgnoringCase(const char *name, const char *attributename, const char *attributevalue)
ssize_t write()
bool insertAttribute(domnode *attribute, uint64_t position)
domnode * wrapChildren(domnode *startchild, domnode *endchild, const char *name)
bool insertChild(domnode *child, uint64_t position)
domnode * getFirstChildIgnoringCase(const char *ns, const char *name)
bool deleteFirstChildIgnoringCase(const char *name, const char *attributename, const char *attributevalue)
virtual domnode * getPreviousSibling()
domnode(dom *dom)
domnode * getFirstTagDescendentIgnoringCase(const char *ns, const char *name, const char *attributename, const char *attributevalue)
ssize_t writeXml(output *out, bool indent)
virtual const char * getValue()
bool unwrapChildren(const char *ns, const char *name)
bool deleteFirstChild(const char *name, const char *attributename, const char *attributevalue)
virtual uint64_t getChildCount()
domnode * getFirstTagChildInSet(const char *const *set)
bool deleteChild(uint64_t position)
domnode * getFirstTagChild()
domnode * getFirstTagChildIgnoringCase(const char *name)
bool deleteAttribute(domnode *attribute)
virtual uint64_t getPosition()
bool deleteDescendents(const char *ns, const char *name, const char *attributename, const char *attributevalue)
domnode * getFirstTagDescendentIgnoringCase(const char *name)
virtual void setNextSibling(domnode *next)
domnode * getNextTag()
void setAttributeValue(const char *name, uint64_t value)
const char * getAttributeValue(uint64_t position)
void setAttributeValue(const char *name, const char *value)
domnode * getNextTag(domnode *top)
domnode * getPreviousTagSiblingIgnoringCase(const char *ns, const char *name, const char *attributename, const char *attributevalue)
bool unwrapChildrenIgnoringCase(const char *name)
const char * getAttributeValueByPath(const char *path, uint64_t position)
const char * getAttributeValue(const char *name)
domnode * getFirstTagChild(const char *name, const char *attributename, const char *attributevalue)
void setName(const char *ns, const char *name)
domnode * getFirstTagChild(const char *name)
bool unwrapDescendentsIgnoringCase(const char *name)
domnode * getNextTagSiblingIgnoringCase(const char *name)
bool deleteFirstChild(const char *ns, const char *name)
bool deleteChildren(const char *ns, const char *name, const char *attributename, const char *attributevalue)
bool deleteChildren()
virtual domnode * getAttribute(uint64_t position)
bool unwrapDescendents(const char *name)
Definition object.h:10
Definition output.h:11
Definition stringbuffer.h:13