lib/ffi/clang/translation_unit.rb in ffi-clang-0.6.0 vs lib/ffi/clang/translation_unit.rb in ffi-clang-0.7.0
- old
+ new
@@ -89,15 +89,19 @@
def location_offset(file, offset)
ExpansionLocation.new Lib.get_location_offset(self, file, offset)
end
- def file(file_name)
- File.new(Lib.get_file(self, file_name), self)
+ def file(file_name = nil)
+ if file_name.nil?
+ File.new(Lib.get_file(self, spelling), self)
+ else
+ File.new(Lib.get_file(self, file_name), self)
+ end
end
def spelling
- Lib.get_translation_unit_spelling(self)
+ Lib.extract_string Lib.get_translation_unit_spelling(self)
end
def resource_usage
FFI::Clang::TranslationUnit::ResourceUsage.new Lib.resource_usage(self)
end