Dylan Reid | 6b590e6 | 2016-10-27 19:10:53 -0700 | [diff] [blame^] | 1 | // Copyright 2016 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CONTAINER_UTILS_CONTAINER_CONFIG_PARSER_H_ |
| 6 | #define CONTAINER_UTILS_CONTAINER_CONFIG_PARSER_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | #include <string> |
| 10 | |
| 11 | #include <base/files/file_path.h> |
| 12 | #include <base/values.h> |
| 13 | |
| 14 | #include "oci_config.h" |
| 15 | |
| 16 | namespace container_utils { |
| 17 | |
| 18 | using OciConfigPtr = std::unique_ptr<OciConfig>; |
| 19 | |
| 20 | // Parses container configuration from the config.json data as specified in |
| 21 | // https://github.com/opencontainers/runtime-spec/tree/v1.0.0-rc1 |
| 22 | // |config_json_data| - The text from config.json. |
| 23 | // |config_out| - Filled with the OCI configuration. |
| 24 | bool ParseContainerConfig(const std::string& config_json_data, |
| 25 | OciConfigPtr const& config_out); |
| 26 | |
| 27 | } // namespace container_utils |
| 28 | |
| 29 | #endif // CONTAINER_UTILS_CONTAINER_CONFIG_PARSER_H_ |