Class CXSourceRange

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class CXSourceRange
    extends Struct
    implements NativeResource
    Identifies a half-open character range in the source code.

    Use getRangeStart and getRangeEnd to retrieve the starting and end locations from a source range, respectively.

    Layout

    
     struct CXSourceRange {
         void const * ptr_data[2];
         unsigned begin_int_data;
         unsigned end_int_data;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • PTR_DATA, BEGIN_INT_DATA, END_INT_DATA

        The struct member offsets.
    • Constructor Detail

      • CXSourceRange

        public CXSourceRange​(java.nio.ByteBuffer container)
        Creates a CXSourceRange instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • ptr_data

        public long ptr_data​(int index)
        Returns the value at the specified index of the ptr_data field.
      • begin_int_data

        public int begin_int_data()
        Returns the value of the begin_int_data field.
      • end_int_data

        public int end_int_data()
        Returns the value of the end_int_data field.
      • malloc

        public static CXSourceRange malloc()
        Returns a new CXSourceRange instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static CXSourceRange calloc()
        Returns a new CXSourceRange instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static CXSourceRange create​(long address)
        Returns a new CXSourceRange instance for the specified memory address.
      • createSafe

        @Nullable
        public static CXSourceRange createSafe​(long address)
        Like create, but returns null if address is NULL.
      • create

        public static CXSourceRange.Buffer create​(long address,
                                                  int capacity)
        Create a CXSourceRange.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static CXSourceRange.Buffer createSafe​(long address,
                                                      int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static CXSourceRange mallocStack()
        Returns a new CXSourceRange instance allocated on the thread-local MemoryStack.
      • callocStack

        public static CXSourceRange callocStack()
        Returns a new CXSourceRange instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static CXSourceRange mallocStack​(MemoryStack stack)
        Returns a new CXSourceRange instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static CXSourceRange callocStack​(MemoryStack stack)
        Returns a new CXSourceRange instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • nptr_data

        public static long nptr_data​(long struct,
                                     int index)
        Unsafe version of ptr_data.
      • nbegin_int_data

        public static int nbegin_int_data​(long struct)
        Unsafe version of begin_int_data().
      • nend_int_data

        public static int nend_int_data​(long struct)
        Unsafe version of end_int_data().