Class: Doxyparser::HFile

Inherits:
Compound show all
Defined in:
lib/nodes/hfile.rb

Overview

Representation of a C/C++ header file

Instance Attribute Summary

Attributes inherited from Compound

#xml_path

Attributes inherited from Node

#basename, #dir, #doc, #name, #node, #parent

Instance Method Summary collapse

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

#classesArray<Class>

Returns classes declared inside this header file.

Returns:

  • (Array<Class>)

    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

#enumsArray<Enum>

Returns enums declared inside this header file.

Returns:

  • (Array<Enum>)

    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_includedArray<HFile>

Returns local header files which are listed as include statements in this header file.

Returns:

  • (Array<HFile>)

    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_includingArray<HFile>

Returns local header files which refer to this one in their include statements.

Returns:

  • (Array<HFile>)

    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

#functionsArray<Function>

Returns functions declared inside this header file.

Returns:

  • (Array<Function>)

    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_includedArray<String>

Returns names for all header files which are listed as include statements in this header file.

Returns:

  • (Array<String>)

    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_includingArray<String>

Returns names for all header files which refer to this one in their include statements.

Returns:

  • (Array<String>)

    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

#namespacesArray<Namespace>

Returns namespaces declared inside this header file.

Returns:

  • (Array<Namespace>)

    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

#structsArray<Struct>

Returns structs declared inside this header file.

Returns:

  • (Array<Struct>)

    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

#typedefsArray<Typedef>

Returns typedefs declared inside this header file.

Returns:

  • (Array<Typedef>)

    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

#variablesArray<Variable>

Returns variables declared inside this header file.

Returns:

  • (Array<Variable>)

    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