예제 #1
0
 def _GetObjCUnionNullReturnValue(self, kind):
     typemap = MojoTypemapForKind(kind)
     if mojom.IsEnumKind(kind):
         return 'static_cast<%s>(0)' % typemap.ObjCWrappedType()
     elif mojom.IsObjectKind(kind) or mojom.IsAnyInterfaceKind(kind):
         return 'nil'
     else:
         return '0'
예제 #2
0
 def _GetObjCPropertyModifiers(self, kind, inside_union=False):
     modifiers = ['nonatomic']
     if (mojom.IsArrayKind(kind) or mojom.IsStringKind(kind) or
             mojom.IsMapKind(kind) or mojom.IsStructKind(kind)):
         modifiers.append('copy')
     if ((inside_union and mojom.IsObjectKind(kind))
             or mojom.IsNullableKind(kind)):
         modifiers.append('nullable')
     return ', '.join(modifiers)
예제 #3
0
def IsPointerArrayKind(kind):
    if not mojom.IsArrayKind(kind):
        return False
    sub_kind = kind.kind
    return mojom.IsObjectKind(sub_kind)
예제 #4
0
def IsPointer(kind):
  return mojom.IsObjectKind(kind) and not mojom.IsUnionKind(kind)
예제 #5
0
def IsObjectField(field):
    return mojom.IsObjectKind(field.kind)