MCPcopy Create free account
hub / github.com/apache/fory / _load_schema

Method _load_schema

compiler/fory_compiler/generators/cpp.py:146–160  ·  view source on GitHub ↗
(self, file_path: str)

Source from the content-addressed store, hash-verified

144 return imported, local
145
146 def _load_schema(self, file_path: str) -> Optional[Schema]:
147 if not file_path:
148 return None
149 if not hasattr(self, "_schema_cache"):
150 self._schema_cache = {}
151 cache: Dict[Path, Schema] = self._schema_cache
152 path = Path(file_path).resolve()
153 if path in cache:
154 return cache[path]
155 try:
156 schema = parse_idl_file(path)
157 except Exception:
158 return None
159 cache[path] = schema
160 return schema
161
162 def _namespace_for_schema(self, schema: Schema) -> str:
163 if schema.package:

Callers 4

_namespace_for_typeMethod · 0.95
_header_for_typeMethod · 0.95
generate_headerMethod · 0.95

Calls 1

parse_idl_fileFunction · 0.90

Tested by

no test coverage detected