blob: 1e1a02407128475d9889dce762d6031b3d55c92e [file] [log] [blame]
Dylan Reid6b590e62016-10-27 19:10:53 -07001// 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
Stephen Barber5f6dc9b2017-04-04 12:36:32 -07005#ifndef RUN_OCI_CONTAINER_CONFIG_PARSER_H_
6#define RUN_OCI_CONTAINER_CONFIG_PARSER_H_
Dylan Reid6b590e62016-10-27 19:10:53 -07007
8#include <memory>
9#include <string>
10
11#include <base/files/file_path.h>
12#include <base/values.h>
13
Stephen Barber5f6dc9b2017-04-04 12:36:32 -070014#include "run_oci/oci_config.h"
Dylan Reid6b590e62016-10-27 19:10:53 -070015
Stephen Barber5f6dc9b2017-04-04 12:36:32 -070016namespace run_oci {
Dylan Reid6b590e62016-10-27 19:10:53 -070017
18using 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.
24bool ParseContainerConfig(const std::string& config_json_data,
25 OciConfigPtr const& config_out);
26
Stephen Barber5f6dc9b2017-04-04 12:36:32 -070027} // namespace run_oci
Dylan Reid6b590e62016-10-27 19:10:53 -070028
Stephen Barber5f6dc9b2017-04-04 12:36:32 -070029#endif // RUN_OCI_CONTAINER_CONFIG_PARSER_H_