Skip to content

Commit

Permalink
rename depth to nodedepth (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
bicycle1885 authored Sep 8, 2017
1 parent 1a27c44 commit 4d9fdf3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/src/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ are two kinds of values that will be returned when reading an element node:
indicates the reader just read an opening tag of an element node while the
latter does the reader just read an ending tag of an element node.

In addition to these functions, there are several functions that are specific
to the streaming reader. The `depth(<rreader>)` function returns the depth of
In addition to these functions, there are several functions that are specific to
the streaming reader. The `nodedepth(<rreader>)` function returns the depth of
the current node. The `expandtree(<reader>)` function expands the current node
into a complete subtree rooted at the node. This function is useful when you
want to use the DOM interfaces for the node. However, the expanded subtree is
Expand Down
2 changes: 1 addition & 1 deletion docs/src/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ Streaming reader
----------------

```@docs
depth(::StreamReader)
expandtree(::StreamReader)
nodetype(::StreamReader)
nodename(::StreamReader)
nodecontent(::StreamReader)
nodedepth(::StreamReader)
namespace(::StreamReader)
```
3 changes: 2 additions & 1 deletion src/EzXML.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export
parsehtml,
readdtd,
validate,
depth,
nodedepth,
expandtree

if is_windows()
Expand All @@ -113,6 +113,7 @@ include("streamreader.jl")
@deprecate setname! setnodename!
@deprecate content nodecontent
@deprecate setcontent! setnodecontent!
@deprecate depth nodedepth

function __init__()
init_error_handler()
Expand Down
4 changes: 2 additions & 2 deletions src/streamreader.jl
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ function read_node(reader)
end

"""
depth(reader::StreamReader)
nodedepth(reader::StreamReader)
Return the depth of the current node of `reader`.
"""
function depth(reader::StreamReader)
function nodedepth(reader::StreamReader)
ret = ccall(
(:xmlTextReaderDepth, libxml2),
Cint,
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ end
for typ in reader
push!(typs, typ)
push!(names, nodename(reader))
push!(depths, depth(reader))
push!(depths, nodedepth(reader))
if typ == EzXML.READER_ELEMENT && nodename(reader) == "elm"
push!(contents, nodecontent(reader))
push!(attributes, reader["attr1"])
Expand Down

0 comments on commit 4d9fdf3

Please sign in to comment.