Lines Matching +full:string +full:- +full:array +full:- +full:property
1 # -*- coding: utf-8 -*-
5 # Copyright (c) 2015-2019 Red Hat Inc.
10 # Marc-André Lureau <marcandre.lureau@redhat.com>
13 # See the COPYING file in the top-level directory.
15 # pylint: disable=too-many-lines
53 ) -> None:
56 def _cgen(self) -> str:
59 def gen_if(self) -> str:
62 def gen_endif(self) -> str:
65 def docgen(self) -> str:
68 def is_present(self) -> bool:
77 The latter uses sub-class `QAPISchemaDefinition`.
89 def __repr__(self) -> str:
92 def check(self, schema: QAPISchema) -> None:
93 # pylint: disable=unused-argument
96 def connect_doc(self, doc: Optional[QAPIDoc] = None) -> None:
101 ) -> None:
107 def set_module(self, schema: QAPISchema) -> None:
110 def visit(self, visitor: QAPISchemaVisitor) -> None:
111 # pylint: disable=unused-argument
134 def __repr__(self) -> str:
138 def c_name(self) -> str:
141 def check(self, schema: QAPISchema) -> None:
148 def connect_doc(self, doc: Optional[QAPIDoc] = None) -> None:
155 @property
156 def ifcond(self) -> QAPISchemaIfCond:
160 def is_implicit(self) -> bool:
163 def describe(self) -> str:
168 def visit_begin(self, schema: QAPISchema) -> None:
171 def visit_end(self) -> None:
174 def visit_module(self, name: str) -> None:
177 def visit_needed(self, entity: QAPISchemaEntity) -> bool:
178 # pylint: disable=unused-argument
182 def visit_include(self, name: str, info: Optional[QAPISourceInfo]) -> None:
187 ) -> None:
198 ) -> None:
207 ) -> None:
219 ) -> None:
230 ) -> None:
240 ) -> None:
257 ) -> None:
268 ) -> None:
281 def is_system_module(name: str) -> bool:
290 def is_user_module(cls, name: str) -> bool:
299 def is_builtin_module(cls, name: str) -> bool:
301 The built-in module is a single System module for the built-in types.
307 def add_entity(self, ent: QAPISchemaEntity) -> None:
310 def visit(self, visitor: QAPISchemaVisitor) -> None:
322 def visit(self, visitor: QAPISchemaVisitor) -> None:
331 def c_type(self) -> str:
335 def c_param_type(self) -> str:
339 def c_unboxed_type(self) -> str:
343 def json_type(self) -> str:
346 def alternate_qtype(self) -> Optional[str]:
349 'string': 'QTYPE_QSTRING',
353 'array': 'QTYPE_QLIST',
358 def doc_type(self) -> Optional[str]:
363 def need_has_if_optional(self) -> bool:
368 def check(self, schema: QAPISchema) -> None:
376 def describe(self) -> str:
381 meta = 'built-in'
385 assert json_type in ('string', 'number', 'int', 'boolean', 'null',
390 def c_name(self) -> str:
393 def c_type(self) -> str:
396 def c_param_type(self) -> str:
401 def json_type(self) -> str:
404 def doc_type(self) -> str:
407 def visit(self, visitor: QAPISchemaVisitor) -> None:
431 def check(self, schema: QAPISchema) -> None:
437 def connect_doc(self, doc: Optional[QAPIDoc] = None) -> None:
443 def is_implicit(self) -> bool:
447 def c_type(self) -> str:
450 def member_names(self) -> List[str]:
453 def json_type(self) -> str:
454 return 'string'
456 def visit(self, visitor: QAPISchemaVisitor) -> None:
464 meta = 'array'
473 def need_has_if_optional(self) -> bool:
474 # When FOO is an array, we still need has_FOO to distinguish
478 def check(self, schema: QAPISchema) -> None:
485 def set_module(self, schema: QAPISchema) -> None:
488 @property
489 def ifcond(self) -> QAPISchemaIfCond:
493 def is_implicit(self) -> bool:
496 def c_type(self) -> str:
499 def json_type(self) -> str:
500 return 'array'
502 def doc_type(self) -> Optional[str]:
506 return 'array of ' + elt_doc_type
508 def visit(self, visitor: QAPISchemaVisitor) -> None:
513 def describe(self) -> str:
544 def check(self, schema: QAPISchema) -> None:
594 ) -> None:
601 def connect_doc(self, doc: Optional[QAPIDoc] = None) -> None:
609 def is_implicit(self) -> bool:
614 def is_empty(self) -> bool:
617 def has_conditional_members(self) -> bool:
620 def c_name(self) -> str:
624 def c_type(self) -> str:
628 def c_unboxed_type(self) -> str:
631 def json_type(self) -> str:
634 def visit(self, visitor: QAPISchemaVisitor) -> None:
662 def check(self, schema: QAPISchema) -> None:
686 if re.match(r'[-+0-9.]', m.name):
700 def connect_doc(self, doc: Optional[QAPIDoc] = None) -> None:
706 def c_type(self) -> str:
709 def json_type(self) -> str:
712 def visit(self, visitor: QAPISchemaVisitor) -> None:
729 def set_defined_in(self, name: str) -> None:
733 # pylint: disable=unused-argument
736 ) -> None:
751 ) -> None:
819 ) -> None:
839 ) -> None:
861 def set_defined_in(self, name: str) -> None:
869 ) -> None:
878 def connect_doc(self, doc: Optional[QAPIDoc]) -> None:
882 def describe(self, info: Optional[QAPISourceInfo]) -> str:
889 # See QAPISchema._make_implicit_object_type() - reverse the
890 # mapping there to create a nice human-readable description
892 if defined_in.endswith('-arg'):
897 defined_in = defined_in[:-4]
898 elif defined_in.endswith('-base'):
901 defined_in = defined_in[:-5]
926 def connect_doc(self, doc: Optional[QAPIDoc]) -> None:
939 def is_special(self) -> bool:
961 def need_has(self) -> bool:
964 def check(self, schema: QAPISchema) -> None:
972 def connect_doc(self, doc: Optional[QAPIDoc]) -> None:
1023 def check(self, schema: QAPISchema) -> None:
1058 def connect_doc(self, doc: Optional[QAPIDoc] = None) -> None:
1065 def visit(self, visitor: QAPISchemaVisitor) -> None:
1092 def check(self, schema: QAPISchema) -> None:
1114 def connect_doc(self, doc: Optional[QAPIDoc] = None) -> None:
1121 def visit(self, visitor: QAPISchemaVisitor) -> None:
1163 def features(self) -> ValuesView[QAPISchemaFeature]:
1166 def _def_entity(self, ent: QAPISchemaEntity) -> None:
1169 def _def_definition(self, defn: QAPISchemaDefinition) -> None:
1173 # TODO reject names that differ only in '_' vs. '.' vs. '-',
1186 def lookup_entity(self, name: str) -> Optional[QAPISchemaEntity]:
1189 def lookup_type(self, name: str) -> Optional[QAPISchemaType]:
1200 ) -> QAPISchemaType:
1203 assert info and what # built-in types must not fail lookup
1210 def _module_name(self, fname: str) -> str:
1215 def _make_module(self, fname: str) -> QAPISchemaModule:
1221 def module_by_fname(self, fname: str) -> QAPISchemaModule:
1225 def _def_include(self, expr: QAPIExpression) -> None:
1233 ) -> None:
1237 # (qapi-builtin-types.[ch]) may be shared by some other
1241 def _def_predefineds(self) -> None:
1242 for t in [('str', 'string', 'char' + POINTER_SUFFIX),
1274 ) -> List[QAPISchemaFeature]:
1293 ) -> QAPISchemaEnumMember:
1300 ) -> List[QAPISchemaEnumMember]:
1307 ) -> str:
1321 ) -> Optional[str]:
1325 name = 'q_obj_%s-%s' % (name, role)
1337 def _def_enum_type(self, expr: QAPIExpression) -> None:
1355 ) -> QAPISchemaObjectTypeMember:
1370 ) -> List[QAPISchemaObjectTypeMember]:
1376 def _def_struct_type(self, expr: QAPIExpression) -> None:
1394 ) -> QAPISchemaVariant:
1400 def _def_union_type(self, expr: QAPIExpression) -> None:
1425 def _def_alternate_type(self, expr: QAPIExpression) -> None:
1443 def _def_command(self, expr: QAPIExpression) -> None:
1448 success_response = expr.get('success-response', True)
1450 allow_oob = expr.get('allow-oob', False)
1451 allow_preconfig = expr.get('allow-preconfig', False)
1468 def _def_event(self, expr: QAPIExpression) -> None:
1482 def _def_exprs(self, exprs: List[QAPIExpression]) -> None:
1501 def check(self) -> None:
1516 def visit(self, visitor: QAPISchemaVisitor) -> None: