Class: Doxyparser::HFile
Overview
Representation of a C/C++ header file
Instance Attribute Summary
Attributes inherited from Compound
Attributes inherited from Node
#basename, #dir, #doc, #name, #node, #parent
Instance Method Summary collapse
-
#classes ⇒ Array<Class>
Classes declared inside this header file.
-
#enums ⇒ Array<Enum>
Enums declared inside this header file.
-
#files_included ⇒ Array<HFile>
Local header files which are listed as include statements in this header file.
-
#files_including ⇒ Array<HFile>
Local header files which refer to this one in their include statements.
-
#functions ⇒ Array<Function>
Functions declared inside this header file.
-
#list_included ⇒ Array<String>
Names for all header files which are listed as include statements in this header file.
-
#list_including ⇒ Array<String>
Names for all header files which refer to this one in their include statements.
-
#namespaces ⇒ Array<Namespace>
Namespaces declared inside this header file.
-
#structs ⇒ Array<Struct>
Structs declared inside this header file.
-
#typedefs ⇒ Array<Typedef>
Typedefs declared inside this header file.
-
#variables ⇒ Array<Variable>
Variables declared inside this header file.
Methods inherited from Node
#==, #eql?, #escaped_name, #initialize, #to_s, #to_str
Methods included from Util
#del_prefix_class, #del_prefix_file, #del_spaces, #do_filter, #escape_all, #escape_class_name, #escape_const_ref_ptr, escape_const_ref_ptr, #escape_file_name, #escape_template, home_dir, #match, read_file, write_file
Constructor Details
This class inherits a constructor from Doxyparser::Node
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Doxyparser::Node
Instance Method Details
#classes ⇒ Array<Class>
Returns classes declared inside this header file.
32 33 34 |
# File 'lib/nodes/hfile.rb', line 32 def classes @classes ||= doc.xpath(%Q{/doxygen/compounddef/innerclass}).select { |c| c["refid"].start_with?("class") }.map { |node| Doxyparser::Class.new(dir: @dir, node: node) } end |
#enums ⇒ Array<Enum>
Returns enums declared inside this header file.
52 53 54 |
# File 'lib/nodes/hfile.rb', line 52 def enums @enums ||= doc.xpath(%Q{/doxygen/compounddef/sectiondef[@kind="enum"]/memberdef[@kind="enum"]}).map { |node| Doxyparser::Enum.new(parent: self, node: node) } end |
#files_included ⇒ Array<HFile>
Returns local header files which are listed as include statements in this header file.
12 13 14 |
# File 'lib/nodes/hfile.rb', line 12 def files_included @files_included ||= doc.xpath(%Q{/doxygen/compounddef/includes[@local="yes"]}).map { |f| Doxyparser::HFile.new(dir: @dir, node: f) } end |
#files_including ⇒ Array<HFile>
Returns local header files which refer to this one in their include statements.
22 23 24 |
# File 'lib/nodes/hfile.rb', line 22 def files_including @files_including ||= doc.xpath(%Q{/doxygen/compounddef/includedby[@local="yes"]}).map { |f| Doxyparser::HFile.new(dir: @dir, node: f) } end |
#functions ⇒ Array<Function>
Returns functions declared inside this header file.
42 43 44 |
# File 'lib/nodes/hfile.rb', line 42 def functions @functions ||= doc.xpath(%Q{/doxygen/compounddef/sectiondef[@kind="func"]/memberdef[@kind="function"]}).map { |node| Doxyparser::Function.new(parent: self, node: node) } end |
#list_included ⇒ Array<String>
Returns names for all header files which are listed as include statements in this header file.
7 8 9 |
# File 'lib/nodes/hfile.rb', line 7 def list_included @list_included ||= doc.xpath(%Q{/doxygen/compounddef/includes}).map { |f| f.child.content } end |
#list_including ⇒ Array<String>
Returns names for all header files which refer to this one in their include statements.
17 18 19 |
# File 'lib/nodes/hfile.rb', line 17 def list_including @list_including ||= doc.xpath(%Q{/doxygen/compounddef/includedby}).map { |f| f[:refid].nil? ? f.child.content : escape_file_name(f[:refid]) } end |
#namespaces ⇒ Array<Namespace>
Returns namespaces declared inside this header file.
37 38 39 |
# File 'lib/nodes/hfile.rb', line 37 def namespaces @namespaces ||= doc.xpath(%Q{/doxygen/compounddef/innernamespace}).map { |node| Doxyparser::Namespace.new(dir: @dir, node: node) } end |
#structs ⇒ Array<Struct>
Returns structs declared inside this header file.
27 28 29 |
# File 'lib/nodes/hfile.rb', line 27 def structs @structs ||= doc.xpath(%Q{/doxygen/compounddef/innerclass}).select { |c| c["refid"].start_with?("struct") }.map { |node| Doxyparser::Struct.new(dir: @dir, node: node) } end |
#typedefs ⇒ Array<Typedef>
Returns typedefs declared inside this header file.
57 58 59 |
# File 'lib/nodes/hfile.rb', line 57 def typedefs @typedefs ||= doc.xpath(%Q{/doxygen/compounddef/sectiondef[@kind="typedef"]/memberdef[@kind="typedef"]}).map { |node| Doxyparser::Typedef.new(parent: self, node: node) } end |
#variables ⇒ Array<Variable>
Returns variables declared inside this header file.
47 48 49 |
# File 'lib/nodes/hfile.rb', line 47 def variables @variables ||= doc.xpath(%Q{/doxygen/compounddef/sectiondef[@kind="var"]/memberdef[@kind="variable"]}).map { |node| Doxyparser::Variable.new(parent: self, node: node) } end |