Lines Matching refs:writer
95 void print_object_of_t(JsonWriter& writer, const char* object_name, std::vector<T> const& vec) {
97 writer.StartKeyedObject(object_name);
99 element.get_manifest_str(writer);
101 writer.EndObject();
105 void print_array_of_t(JsonWriter& writer, const char* object_name, std::vector<T> const& vec) {
107 writer.StartKeyedArray(object_name);
109 element.get_manifest_str(writer);
111 writer.EndArray();
113 void print_vector_of_strings(JsonWriter& writer, const char* object_name, std::vector<std::string> const& strings) {
115 writer.StartKeyedArray(object_name);
117 writer.AddString(fs::fixup_backslashes_in_path(str));
119 writer.EndArray();
125 JsonWriter writer;
126 writer.StartObject();
127 writer.AddKeyedString("file_format_version", file_format_version.get_version_str());
128 writer.StartKeyedObject("ICD");
129 writer.AddKeyedString("library_path", fs::fixup_backslashes_in_path(lib_path).str());
130 writer.AddKeyedString("api_version", version_to_string(api_version));
131 writer.AddKeyedBool("is_portability_driver", is_portability_driver);
132 if (!library_arch.empty()) writer.AddKeyedString("library_arch", library_arch);
133 writer.EndObject();
134 writer.EndObject();
135 return writer.output;
138 void ManifestLayer::LayerDescription::Extension::get_manifest_str(JsonWriter& writer) const {
139 writer.StartObject();
140 writer.AddKeyedString("name", name);
141 writer.AddKeyedString("spec_version", std::to_string(spec_version));
142 writer.AddKeyedString("spec_version", std::to_string(spec_version));
143 print_vector_of_strings(writer, "entrypoints", entrypoints);
144 writer.EndObject();
147 void ManifestLayer::LayerDescription::get_manifest_str(JsonWriter& writer) const {
148 writer.AddKeyedString("name", name);
149 writer.AddKeyedString("type", get_type_str(type));
151 writer.AddKeyedString("library_path", fs::fixup_backslashes_in_path(lib_path.str()));
153 writer.AddKeyedString("api_version", version_to_string(api_version));
154 writer.AddKeyedString("implementation_version", std::to_string(implementation_version));
155 writer.AddKeyedString("description", description);
156 print_object_of_t(writer, "functions", functions);
157 print_array_of_t(writer, "instance_extensions", instance_extensions);
158 print_array_of_t(writer, "device_extensions", device_extensions);
160 writer.StartKeyedObject("enable_environment");
161 writer.AddKeyedString(enable_environment, "1");
162 writer.EndObject();
165 writer.StartKeyedObject("disable_environment");
166 writer.AddKeyedString(disable_environment, "1");
167 writer.EndObject();
169 print_vector_of_strings(writer, "component_layers", component_layers);
170 print_vector_of_strings(writer, "blacklisted_layers", blacklisted_layers);
171 print_vector_of_strings(writer, "override_paths", override_paths);
172 print_vector_of_strings(writer, "app_keys", app_keys);
173 print_object_of_t(writer, "pre_instance_functions", pre_instance_functions);
175 writer.AddKeyedString("library_arch", library_arch);
189 JsonWriter writer;
190 writer.StartObject();
191 writer.AddKeyedString("file_format_version", file_format_version.get_version_str());
193 writer.StartKeyedObject("layer");
194 layers.at(0).get_manifest_str(writer);
195 writer.EndObject();
197 writer.StartKeyedArray("layers");
199 writer.StartObject();
200 layers.at(i).get_manifest_str(writer);
201 writer.EndObject();
203 writer.EndArray();
205 writer.EndObject();
206 return writer.output;