/usr/share/pyshared/pygccxml/declarations/variable.py is in python-pygccxml 1.0.0-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | # Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""
defines class that describes C++ global and member variable declaration
"""
import declaration
import dependencies
import class_declaration
class variable_t( declaration.declaration_t ):
"""describes C++ global and member variable declaration"""
def __init__( self, name='', type=None, type_qualifiers=None, value=None, bits=None):
"""creates class that describes C++ global or member variable"""
declaration.declaration_t.__init__( self, name )
self._type = type
self._type_qualifiers = type_qualifiers
self._value = value
self._bits = bits
self._byte_offset = 0
def _get__cmp__items( self ):
"""implementation details"""
return [ self.type, self.type_qualifiers, self.value ]
def __eq__(self, other):
"""implementation details"""
if not declaration.declaration_t.__eq__( self, other ):
return False
return self.type == other.type \
and self.type_qualifiers == other.type_qualifiers \
and self.value == other.value \
and self.bits == other.bits
def _get_type(self):
return self._type
def _set_type(self, type):
self._type = type
type = property( _get_type, _set_type
, doc="reference to the variable L{type<type_t>}" )
def _get_type_qualifiers(self):
return self._type_qualifiers
def _set_type_qualifiers(self, type_qualifiers):
self._type_qualifiers = type_qualifiers
type_qualifiers = property( _get_type_qualifiers, _set_type_qualifiers
, doc="reference to the L{type_qualifiers_t} instance" )
def _get_value(self):
return self._value
def _set_value(self, value):
self._value = value
value = property( _get_value, _set_value
, doc="string, that contains the variable value" )
def _get_bits(self):
return self._bits
def _set_bits(self, bits):
self._bits = bits
bits = property( _get_bits, _set_bits
, doc="integer, that contains information about how many bit takes bit field")
def _get_byte_offset(self):
return self._byte_offset
def _set_byte_offset(self, byte_offset):
self._byte_offset = byte_offset
byte_offset = property( _get_byte_offset, _set_byte_offset
, doc="integer, offset of the field from the beginning of class.")
@property
def access_type(self):
if not isinstance( self.parent, class_declaration.class_t ):
raise RuntimeError( "access_type functionality only available on member variables and not on global variables" )
return self.parent.find_out_member_access_type( self )
def i_depend_on_them( self, recursive=True ):
return [ dependencies.dependency_info_t( self, self.type ) ]
|