1  from . import enums 
 2  from pygccxml import declarations 
11   
14          self.__full_name = full_name 
15          self.__identifiers = self.__split_scope_identifiers() 
16          self.__scope_identifiers = None 
 17   
18      @property 
20          return self.__identifiers[-1] 
 21   
22      @property 
24          if None is self.__scope_identifiers: 
25              self.__scope_identifiers = [] 
26              for i in range( len(self.__identifiers) - 1): 
27                  self.__scope_identifiers.append( '::'.join( self.__identifiers[0:i+1] ) ) 
28          return self.__scope_identifiers 
 29   
30      @property 
32          return self.__identifiers 
 33   
35          try: 
36              result = [] 
37              tmp = self.__full_name.split( '::' ) 
38              tmp.reverse() 
39              while tmp: 
40                  token = tmp.pop() 
41                  less_count = token.count( '<' ) 
42                  greater_count = token.count( '>' ) 
43                  if less_count != greater_count: 
44                      while less_count != greater_count and tmp: 
45                          next_token = tmp.pop() 
46                          token = token + '::' + next_token 
47                          less_count += next_token.count( '<' ) 
48                          greater_count += next_token.count( '>' ) 
49                  result.append( token ) 
50              return result 
51          except Exception, err: 
52              msg = 'Unable to split scope for identifiers. The full scope name is: "%s". Error: %s' 
53              msg = msg % ( self.__full_name, str(err) ) 
54              raise RuntimeError( msg )