예제 #1
0
 internal unsafe SourceLocation(Interop.SourceLocation native) {
     Native = native;
     IntPtr file = IntPtr.Zero;
     uint line, column, offset;
     Interop.clang_getInstantiationLocation(Native, &file, out line, out column, out offset);
     Line = (int)line;
     Column = (int)column;
     Offset = (int)offset;
     File = new File(file);
 }
예제 #2
0
 internal unsafe CodeCompletion(Interop.CompletionResult* native) {
     IntPtr completionString = native->completionString;
     Chunks = new Chunk[Interop.clang_getNumCompletionChunks(completionString)];
     for (uint i = 0; i < Chunks.Count(); ++i) {
         Chunks[(int)i] = new Chunk(
             Interop.clang_getCompletionChunkKind(completionString, i),
             Interop.clang_getCompletionChunkText(completionString, i).ManagedString);
     }
     Priority = Interop.clang_getCompletionPriority(completionString);
     Availability = Interop.clang_getCompletionAvailability(completionString);
     Annotations = new string[Interop.clang_getCompletionNumAnnotations(completionString)];
     for (uint i = 0; i < Annotations.Count(); ++i) {
         Annotations[(int)i] = Interop.clang_getCompletionAnnotation(completionString, i).ManagedString;
     }
     Comment = Interop.clang_getCompletionAnnotation(completionString).ManagedString;
 }
예제 #3
0
 internal Cursor(Interop.Cursor native)
 {
     Native = native;
     Kind = Interop.clang_getCursorKind(Native);
 }
예제 #4
0
 public Cursor GetOverloadedDecl(uint i)
 {
     return(new Cursor(Interop.clang_getOverloadedDecl(Native, i)));
 }
예제 #5
0
 public Type GetArgumentType(uint i)
 {
     return(new Type(Interop.clang_getArgType(Native, i)));
 }
예제 #6
0
 public Cursor GetArgument(uint i)
 {
     return(new Cursor(Interop.clang_Cursor_getArgument(Native, i)));
 }
예제 #7
0
 public override int GetHashCode()
 {
     return((int)((long)Interop.clang_hashCursor(Native) - UInt32.MaxValue / 2));
 }
예제 #8
0
 /// <summary>
 /// Determine whether two cursors are equivalent.
 /// </summary>
 /// <param name="other">The cursor to compare with.</param>
 /// <returns></returns>
 public bool Equals(Cursor other)
 {
     return(Interop.clang_equalCursors(Native, other.Native) != 0);
 }
예제 #9
0
 internal Cursor(Interop.Cursor native)
 {
     Native = native;
     Kind   = Interop.clang_getCursorKind(Native);
 }