blob: 681edc5990d0b62aa57c07b026e727f24bd77a6a [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include <vector>
#include "rapidjson/document.h"
#include "src/lib/json_parser/json_parser.h"
namespace component {
class SandboxMetadata {
// Parses the given value as a sandbox entry. |json_parser| is used to report any errors.
void Parse(const rapidjson::Value& sandbox_value, json::JSONParser* json_parser);
bool HasFeature(const std::string& feature) const;
void AddFeature(std::string feature);
bool HasService(const std::string& service) const;
// Returns true if the |pkgfs_path| is provided in this namespace.
bool HasPkgFsPath(const std::string& pkgfs_path) const;
const std::vector<std::string>& dev() const { return dev_; }
const std::vector<std::string>& system() const { return system_; }
const std::vector<std::string>& services() const { return services_; }
const std::vector<std::string>& pkgfs() const { return pkgfs_; }
const std::vector<std::string>& features() const { return features_; }
const std::vector<std::string>& boot() const { return boot_; }
bool IsNull() const { return null_; }
bool null_ = true;
std::vector<std::string> dev_;
std::vector<std::string> system_;
std::vector<std::string> services_;
std::vector<std::string> pkgfs_;
std::vector<std::string> features_;
std::vector<std::string> boot_;
} // namespace component