commit
7ff87df56c
1 changed files with 11 additions and 0 deletions
|
|
@ -74,6 +74,12 @@ proc text*(n: XmlNode): string {.inline.} =
|
||||||
assert n.k in {xnText, xnComment, xnCData, xnEntity}
|
assert n.k in {xnText, xnComment, xnCData, xnEntity}
|
||||||
result = n.fText
|
result = n.fText
|
||||||
|
|
||||||
|
proc `text=`*(n: XmlNode, text: string){.inline.} =
|
||||||
|
## sets the associated text with the node `n`. `n` can be a CDATA, Text,
|
||||||
|
## comment, or entity node.
|
||||||
|
assert n.k in {xnText, xnComment, xnCData, xnEntity}
|
||||||
|
n.fText = text
|
||||||
|
|
||||||
proc rawText*(n: XmlNode): string {.inline.} =
|
proc rawText*(n: XmlNode): string {.inline.} =
|
||||||
## returns the underlying 'text' string by reference.
|
## returns the underlying 'text' string by reference.
|
||||||
## This is only used for speed hacks.
|
## This is only used for speed hacks.
|
||||||
|
|
@ -115,6 +121,11 @@ proc `[]`* (n: XmlNode, i: int): XmlNode {.inline.} =
|
||||||
assert n.k == xnElement
|
assert n.k == xnElement
|
||||||
result = n.s[i]
|
result = n.s[i]
|
||||||
|
|
||||||
|
proc delete*(n: XmlNode, i: Natural) {.noSideEffect.} =
|
||||||
|
## delete the `i`'th child of `n`.
|
||||||
|
assert n.k == xnElement
|
||||||
|
n.s.delete(i)
|
||||||
|
|
||||||
proc mget* (n: var XmlNode, i: int): var XmlNode {.inline.} =
|
proc mget* (n: var XmlNode, i: int): var XmlNode {.inline.} =
|
||||||
## returns the `i`'th child of `n` so that it can be modified
|
## returns the `i`'th child of `n` so that it can be modified
|
||||||
assert n.k == xnElement
|
assert n.k == xnElement
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue