Class: AutoC::Module::Header
Instance Attribute Summary collapse
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
Attributes inherited from File
Instance Method Summary collapse
-
#initialize(*args) ⇒ Header
constructor
A new instance of Header.
- #new_stream ⇒ Object
- #write(stream) ⇒ Object
Methods inherited from File
Constructor Details
#initialize(*args) ⇒ Header
Returns a new instance of Header.
164 165 166 167 168 |
# File 'lib/autoc/code.rb', line 164 def initialize(*args) super @file_name = "#{@module.name.downcase}_auto.h" @guard_macro = "#{@module.name.upcase}_AUTO_H" end |
Instance Attribute Details
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
162 163 164 |
# File 'lib/autoc/code.rb', line 162 def file_name @file_name end |
Instance Method Details
#new_stream ⇒ Object
170 171 172 |
# File 'lib/autoc/code.rb', line 170 def new_stream ::File.new(@file_name, "w") end |
#write(stream) ⇒ Object
174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/autoc/code.rb', line 174 def write(stream) stream << %$ /* AUTOMATICALLY GENERATED HEADER FILE. DO NOT MODIFY. */ #ifndef #{@guard_macro} #define #{@guard_macro} $ AutoC.priority_sort(entities).each {|e| e.write_intf(stream)} stream << %$ #endif $ end |