From 4d9fdf3e7b88c92326f63f227feff54bdbad37f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kenta=20Sato=20=28=E4=BD=90=E8=97=A4=20=E5=BB=BA=E5=A4=AA?= =?UTF-8?q?=29?= Date: Sat, 9 Sep 2017 00:00:43 +0900 Subject: [PATCH] rename depth to nodedepth (#27) --- docs/src/manual.md | 4 ++-- docs/src/references.md | 2 +- src/EzXML.jl | 3 ++- src/streamreader.jl | 4 ++-- test/runtests.jl | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/src/manual.md b/docs/src/manual.md index 362baf5..dff71db 100644 --- a/docs/src/manual.md +++ b/docs/src/manual.md @@ -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()` function returns the depth of +In addition to these functions, there are several functions that are specific to +the streaming reader. The `nodedepth()` function returns the depth of the current node. The `expandtree()` 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 diff --git a/docs/src/references.md b/docs/src/references.md index ade5036..5ae3f8a 100644 --- a/docs/src/references.md +++ b/docs/src/references.md @@ -197,10 +197,10 @@ Streaming reader ---------------- ```@docs -depth(::StreamReader) expandtree(::StreamReader) nodetype(::StreamReader) nodename(::StreamReader) nodecontent(::StreamReader) +nodedepth(::StreamReader) namespace(::StreamReader) ``` diff --git a/src/EzXML.jl b/src/EzXML.jl index b9d55f2..c89e31e 100644 --- a/src/EzXML.jl +++ b/src/EzXML.jl @@ -92,7 +92,7 @@ export parsehtml, readdtd, validate, - depth, + nodedepth, expandtree if is_windows() @@ -113,6 +113,7 @@ include("streamreader.jl") @deprecate setname! setnodename! @deprecate content nodecontent @deprecate setcontent! setnodecontent! +@deprecate depth nodedepth function __init__() init_error_handler() diff --git a/src/streamreader.jl b/src/streamreader.jl index 23a0a17..f15036d 100644 --- a/src/streamreader.jl +++ b/src/streamreader.jl @@ -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, diff --git a/test/runtests.jl b/test/runtests.jl index e4fd752..0769c9b 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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"])