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);
 }
 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;
 }
Exemple #3
0
 internal Cursor(Interop.Cursor native)
 {
     Native = native;
     Kind = Interop.clang_getCursorKind(Native);
 }
Exemple #4
0
 public Cursor GetOverloadedDecl(uint i)
 {
     return(new Cursor(Interop.clang_getOverloadedDecl(Native, i)));
 }
Exemple #5
0
 public Type GetArgumentType(uint i)
 {
     return(new Type(Interop.clang_getArgType(Native, i)));
 }
Exemple #6
0
 public Cursor GetArgument(uint i)
 {
     return(new Cursor(Interop.clang_Cursor_getArgument(Native, i)));
 }
Exemple #7
0
 public override int GetHashCode()
 {
     return((int)((long)Interop.clang_hashCursor(Native) - UInt32.MaxValue / 2));
 }
Exemple #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);
 }
Exemple #9
0
 internal Cursor(Interop.Cursor native)
 {
     Native = native;
     Kind   = Interop.clang_getCursorKind(Native);
 }