Пример #1
0
 public bool Equals(ClangSourceLocation other)
 {
     return(LibClang.clang_equalLocations(source, other.source) != 0);
 }
Пример #2
0
 public static ClangSourceRange GetRange(ClangSourceLocation begin, ClangSourceLocation end)
 {
     return(new ClangSourceRange(LibClang.clang_getRange(begin.Source, end.Source)));
 }
Пример #3
0
        // PhysicalSourceLocations

        /* does not exist in clang 3.5
         *
         * int? range_size;
         *
         * public ClangSourceRange [] GetSkippedRanges (ClangFile file)
         * {
         *      int size = (int) (range_size ?? (range_size = Marshal.SizeOf (typeof (ClangSourceRange))));
         *      var ret = LibClang.clang_getSkippedRanges (Handle, file.Handle);
         *      try {
         *              var rl = Marshal.PtrToStructure<CXSourceRangeList> (ret);
         *              return Enumerable.Range (0, (int) rl.Count).Select (i => new ClangSourceRange (Marshal.PtrToStructure<CXSourceRange> (rl.Ranges + size * i))).ToArray ();
         *      } finally {
         *              LibClang.clang_disposeSourceRangeList (ret);
         *      }
         * }
         */

        // MappingBetweenCursorAndLocation

        public ClangCursor GetCursor(ClangSourceLocation location)
        {
            return(new ClangCursor(LibClang.clang_getCursor(Handle, location.Source)));
        }