Class: Ritsu::SrcFiles::HeaderFile
- Inherits:
-
Ritsu::SrcFile
show all
- Defined in:
- lib/ritsu/src_files/header_file.rb,
lib/ritsu/ext/qt/src_files/header_file.rb
Instance Attribute Summary
#owner, #src_path
Instance Method Summary
collapse
#abs_path, #base_name, find_by_src_path, #include_in_source_files?, is_valid_src_path?, #project, #remove, #update, #update_content, validate_instance
Methods included from Utility
platform
included, #initialize_instance
Constructor Details
#initialize(src_path, owner, options = {}) ⇒ HeaderFile
Returns a new instance of HeaderFile.
9
10
11
|
# File 'lib/ritsu/src_files/header_file.rb', line 9
def initialize(src_path, owner)
super(src_path, owner)
end
|
Instance Method Details
#cpp_file? ⇒ Boolean
33
34
35
|
# File 'lib/ritsu/src_files/header_file.rb', line 33
def cpp_file?
false
end
|
#create ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/ritsu/src_files/header_file.rb', line 13
def create
Ritsu::Utility::FileRobot.create_file(abs_path,
"#ifndef #{include_guard}\n" +
"#define #{include_guard}\n" +
"\n" +
"////////////////////\n" +
"// YOUR CODE HERE //\n" +
"////////////////////\n" +
"\n" +
"#endif\n")
end
|
29
30
31
|
# File 'lib/ritsu/src_files/header_file.rb', line 29
def
true
end
|
#include_guard ⇒ Object
25
26
27
|
# File 'lib/ritsu/src_files/header_file.rb', line 25
def include_guard
'__' + project.name.underscore.upcase + '_' + src_path.gsub(/[.\/]+/,'_').upcase + '__'
end
|
#initialize_target_before_qt ⇒ HeaderFile
Returns a new instance of HeaderFile.
6
7
8
|
# File 'lib/ritsu/ext/qt/src_files/header_file.rb', line 6
def initialize(src_path, owner)
super(src_path, owner)
end
|
14
15
16
|
# File 'lib/ritsu/ext/qt/src_files/header_file.rb', line 14
def
@qt_header_file
end
|