lib/ffi/clang/translation_unit.rb in ffi-clang-0.1.0 vs lib/ffi/clang/translation_unit.rb in ffi-clang-0.1.1

- old
+ new

@@ -18,10 +18,11 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. require 'ffi/clang/lib/translation_unit' +require 'ffi/clang/cursor' module FFI module Clang class TranslationUnit < AutoPointer def initialize(pointer) @@ -38,8 +39,11 @@ n.times.map do |i| Diagnostic.new(self, Lib.get_diagnostic(self, i)) end end + def cursor + Cursor.new(Lib.get_translation_unit_cursor(self)) + end end end end