class Doxyparser::Namespace
A C/C++ Namespace
Public Instance Methods
classes(filter=nil)
click to toggle source
@return [Array<Class>] list of classes defined in this namespace
# File lib/nodes/namespace.rb, line 63 def classes(filter=nil) return @classes if @classes lst = doc.xpath(%Q{/doxygen/compounddef/innerclass}) lst = lst.select { |c| c["refid"].start_with?("class") } @classes = do_filter(filter, lst, Doxyparser::Class) { |node| del_spaces del_prefix_class(node.child.content) } end
enums(filter=nil)
click to toggle source
@return [Array<Enum>] list of enums defined inside this namespace but outside any {Class} or {Struct}
# File lib/nodes/namespace.rb, line 16 def enums(filter=nil) return @enums if @enums lst = doc.xpath(%Q{/doxygen/compounddef/sectiondef[@kind="enum"]/memberdef[@kind="enum"]}) filter.map! { |exp| exp =~ /^#{@basename}_Enum/ ? /@\d*/ : exp } unless filter.nil? @enums = do_filter(filter, lst, Doxyparser::Enum) { |node| node.xpath("name")[0].child.content.strip } end
file()
click to toggle source
@return nil always
# File lib/nodes/namespace.rb, line 73 def file nil end
functions(filter=nil)
click to toggle source
@return [Array<Function>] list of functions defined inside this namespace but outside any {Class} or {Struct}
# File lib/nodes/namespace.rb, line 7 def functions(filter=nil) return @functions if @functions lst = doc.xpath(%Q{/doxygen/compounddef/sectiondef[@kind="func"]/memberdef[@kind="function"]}) @functions = do_filter(filter, lst, Doxyparser::Function) { |node| node.xpath("name")[0].child.content.strip } end
innernamespaces(filter=nil)
click to toggle source
@return [Array<Namespace>] list of namespaces defined inside this one
# File lib/nodes/namespace.rb, line 44 def innernamespaces(filter=nil) return @innernamespaces if @innernamespaces lst = doc.xpath(%Q{/doxygen/compounddef/innernamespace}) @innernamespaces = do_filter(filter, lst, Doxyparser::Namespace) { |node| del_spaces del_prefix_class(node.child.content) } end
structs(filter=nil)
click to toggle source
@return [Array<Struct>] list of structs defined in this namespace
# File lib/nodes/namespace.rb, line 53 def structs(filter=nil) return @structs if @structs lst = doc.xpath(%Q{/doxygen/compounddef/innerclass}) lst = lst.select { |c| c["refid"].start_with?("struct") } @structs = do_filter(filter, lst, Doxyparser::Struct) { |node| del_spaces del_prefix_class(node.child.content) } end
typedefs(filter=nil)
click to toggle source
@return [Array<Typedef>] list of typedefs defined inside this namespace but outside any {Class} or {Struct}
# File lib/nodes/namespace.rb, line 35 def typedefs(filter=nil) return @typedefs if @typedefs lst = doc.xpath(%Q{/doxygen/compounddef/sectiondef[@kind="typedef"]/memberdef[@kind="typedef"]}) @typedefs = do_filter(filter, lst, Doxyparser::Typedef) { |node| del_spaces(node.xpath("name")[0].child.content) } end
variables(filter=nil)
click to toggle source
@return [Array<Variable>] list of variables defined inside this namespace but are not attributes of any {Class} or {Struct}
# File lib/nodes/namespace.rb, line 26 def variables(filter=nil) return @variables if @variables lst = doc.xpath(%Q{/doxygen/compounddef/sectiondef[@kind="var"]/memberdef[@kind="variable"]}) @variables = do_filter(filter, lst, Doxyparser::Variable) { |node| node.xpath("name")[0].child.content.strip } end
Private Instance Methods
compute_path()
click to toggle source
# File lib/nodes/namespace.rb, line 79 def compute_path aux = escape_class_name(@name) @xml_path = %Q{#{@dir}/namespace#{aux}.xml} end