How to use the pybind11.tools.clang.cindex.StorageClass function in pybind11

To help you get started, we’ve selected a few pybind11 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github YannickJadoul / Parselmouth / pybind11 / tools / clang / cindex.py View on Github external
def storage_class(self):
        """
        Retrieves the storage class (if any) of the entity pointed at by the
        cursor.
        """
        if not hasattr(self, '_storage_class'):
            self._storage_class = conf.lib.clang_Cursor_getStorageClass(self)

        return StorageClass.from_id(self._storage_class)
github YannickJadoul / Parselmouth / pybind11 / tools / clang / cindex.py View on Github external
    @staticmethod
    def from_id(id):
        if id >= len(StorageClass._kinds) or not StorageClass._kinds[id]:
            raise ValueError('Unknown storage class %d' % id)
        return StorageClass._kinds[id]

    def __repr__(self):
        return 'StorageClass.%s' % (self.name,)

StorageClass.INVALID = StorageClass(0)
StorageClass.NONE = StorageClass(1)
StorageClass.EXTERN = StorageClass(2)
StorageClass.STATIC = StorageClass(3)
StorageClass.PRIVATEEXTERN = StorageClass(4)
StorageClass.OPENCLWORKGROUPLOCAL = StorageClass(5)
StorageClass.AUTO = StorageClass(6)
StorageClass.REGISTER = StorageClass(7)


### C++ access specifiers ###

class AccessSpecifier(BaseEnumeration):
    """
    Describes the access of a C++ class member
    """

    # The unique kind objects, index by id.
    _kinds = []
    _name_map = None

    def from_param(self):
github YannickJadoul / Parselmouth / pybind11 / tools / clang / cindex.py View on Github external
def name(self):
        """Get the enumeration name of this storage class."""
        if self._name_map is None:
            self._name_map = {}
            for key,value in list(StorageClass.__dict__.items()):
                if isinstance(value,StorageClass):
                    self._name_map[value] = key
        return self._name_map[self]
github YannickJadoul / Parselmouth / pybind11 / tools / clang / cindex.py View on Github external
self._name_map[value] = key
        return self._name_map[self]

    @staticmethod
    def from_id(id):
        if id >= len(StorageClass._kinds) or not StorageClass._kinds[id]:
            raise ValueError('Unknown storage class %d' % id)
        return StorageClass._kinds[id]

    def __repr__(self):
        return 'StorageClass.%s' % (self.name,)

StorageClass.INVALID = StorageClass(0)
StorageClass.NONE = StorageClass(1)
StorageClass.EXTERN = StorageClass(2)
StorageClass.STATIC = StorageClass(3)
StorageClass.PRIVATEEXTERN = StorageClass(4)
StorageClass.OPENCLWORKGROUPLOCAL = StorageClass(5)
StorageClass.AUTO = StorageClass(6)
StorageClass.REGISTER = StorageClass(7)


### C++ access specifiers ###

class AccessSpecifier(BaseEnumeration):
    """
    Describes the access of a C++ class member
    """

    # The unique kind objects, index by id.
    _kinds = []
    _name_map = None
github YannickJadoul / Parselmouth / pybind11 / tools / clang / cindex.py View on Github external
def from_id(id):
        if id >= len(StorageClass._kinds) or not StorageClass._kinds[id]:
            raise ValueError('Unknown storage class %d' % id)
        return StorageClass._kinds[id]
github YannickJadoul / Parselmouth / pybind11 / tools / clang / cindex.py View on Github external
self._name_map = {}
            for key,value in list(StorageClass.__dict__.items()):
                if isinstance(value,StorageClass):
                    self._name_map[value] = key
        return self._name_map[self]

    @staticmethod
    def from_id(id):
        if id >= len(StorageClass._kinds) or not StorageClass._kinds[id]:
            raise ValueError('Unknown storage class %d' % id)
        return StorageClass._kinds[id]

    def __repr__(self):
        return 'StorageClass.%s' % (self.name,)

StorageClass.INVALID = StorageClass(0)
StorageClass.NONE = StorageClass(1)
StorageClass.EXTERN = StorageClass(2)
StorageClass.STATIC = StorageClass(3)
StorageClass.PRIVATEEXTERN = StorageClass(4)
StorageClass.OPENCLWORKGROUPLOCAL = StorageClass(5)
StorageClass.AUTO = StorageClass(6)
StorageClass.REGISTER = StorageClass(7)


### C++ access specifiers ###

class AccessSpecifier(BaseEnumeration):
    """
    Describes the access of a C++ class member
    """
github YannickJadoul / Parselmouth / pybind11 / tools / clang / cindex.py View on Github external
    @staticmethod
    def from_id(id):
        if id >= len(StorageClass._kinds) or not StorageClass._kinds[id]:
            raise ValueError('Unknown storage class %d' % id)
        return StorageClass._kinds[id]

    def __repr__(self):
        return 'StorageClass.%s' % (self.name,)

StorageClass.INVALID = StorageClass(0)
StorageClass.NONE = StorageClass(1)
StorageClass.EXTERN = StorageClass(2)
StorageClass.STATIC = StorageClass(3)
StorageClass.PRIVATEEXTERN = StorageClass(4)
StorageClass.OPENCLWORKGROUPLOCAL = StorageClass(5)
StorageClass.AUTO = StorageClass(6)
StorageClass.REGISTER = StorageClass(7)


### C++ access specifiers ###

class AccessSpecifier(BaseEnumeration):
    """
    Describes the access of a C++ class member
    """

    # The unique kind objects, index by id.
    _kinds = []
    _name_map = None

    def from_param(self):
        return self.value
github YannickJadoul / Parselmouth / pybind11 / tools / clang / cindex.py View on Github external
return self._name_map[self]

    @staticmethod
    def from_id(id):
        if id >= len(StorageClass._kinds) or not StorageClass._kinds[id]:
            raise ValueError('Unknown storage class %d' % id)
        return StorageClass._kinds[id]

    def __repr__(self):
        return 'StorageClass.%s' % (self.name,)

StorageClass.INVALID = StorageClass(0)
StorageClass.NONE = StorageClass(1)
StorageClass.EXTERN = StorageClass(2)
StorageClass.STATIC = StorageClass(3)
StorageClass.PRIVATEEXTERN = StorageClass(4)
StorageClass.OPENCLWORKGROUPLOCAL = StorageClass(5)
StorageClass.AUTO = StorageClass(6)
StorageClass.REGISTER = StorageClass(7)


### C++ access specifiers ###

class AccessSpecifier(BaseEnumeration):
    """
    Describes the access of a C++ class member
    """

    # The unique kind objects, index by id.
    _kinds = []
    _name_map = None
github YannickJadoul / Parselmouth / pybind11 / tools / clang / cindex.py View on Github external
for key,value in list(StorageClass.__dict__.items()):
                if isinstance(value,StorageClass):
                    self._name_map[value] = key
        return self._name_map[self]

    @staticmethod
    def from_id(id):
        if id >= len(StorageClass._kinds) or not StorageClass._kinds[id]:
            raise ValueError('Unknown storage class %d' % id)
        return StorageClass._kinds[id]

    def __repr__(self):
        return 'StorageClass.%s' % (self.name,)

StorageClass.INVALID = StorageClass(0)
StorageClass.NONE = StorageClass(1)
StorageClass.EXTERN = StorageClass(2)
StorageClass.STATIC = StorageClass(3)
StorageClass.PRIVATEEXTERN = StorageClass(4)
StorageClass.OPENCLWORKGROUPLOCAL = StorageClass(5)
StorageClass.AUTO = StorageClass(6)
StorageClass.REGISTER = StorageClass(7)


### C++ access specifiers ###

class AccessSpecifier(BaseEnumeration):
    """
    Describes the access of a C++ class member
    """

    # The unique kind objects, index by id.