Android-cuttlefish cvd tool
load_configs_parser.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <functional>
20#include <map>
21#include <string>
22#include <vector>
23
25#include "cuttlefish/host/commands/cvd/cli/parser/load_config.pb.h"
30
31namespace cuttlefish {
32
33struct CvdFlags {
34 std::vector<std::string> launch_cvd_flags;
36 std::vector<std::string> fetch_cvd_flags;
37 std::string target_directory;
38};
39
40struct LoadFlags {
41 std::map<std::string, std::string, std::less<void>> overrides;
42 std::string base_dir;
43};
44
45std::vector<Flag> BuildCvdLoadFlags(LoadFlags& load_flags);
46
48 const std::string& config_path,
49 const std::map<std::string, std::string, std::less<void>>& overrides);
50
52 const std::string& parent_directory,
53 const cvd::config::EnvironmentSpecification& env_spec);
54
56 const cvd::config::EnvironmentSpecification& env_spec,
57 const LocalInstanceGroup& group);
58
59}; // namespace cuttlefish
Definition: local_instance_group.h:32
Definition: alloc_driver.h:20
std::vector< Flag > BuildCvdLoadFlags(LoadFlags &load_flags)
Definition: load_configs_parser.cpp:248
Result< InstanceManager::GroupDirectories > GetGroupCreationDirectories(const std::string &parent_directory, const EnvironmentSpecification &env_spec)
Definition: load_configs_parser.cpp:306
Result< EnvironmentSpecification > GetEnvironmentSpecification(const std::string &config_path, const std::map< std::string, std::string, std::less< void > > &overrides)
Definition: load_configs_parser.cpp:369
tl::expected< T, StackTraceError > Result
Definition: result_type.h:30
Result< CvdFlags > ParseCvdConfigs(const EnvironmentSpecification &env_spec, const LocalInstanceGroup &group)
Definition: load_configs_parser.cpp:348
Definition: load_configs_parser.h:33
std::string target_directory
Definition: load_configs_parser.h:37
std::vector< std::string > launch_cvd_flags
Definition: load_configs_parser.h:34
selector::SelectorOptions selector_flags
Definition: load_configs_parser.h:35
std::vector< std::string > fetch_cvd_flags
Definition: load_configs_parser.h:36
Definition: load_configs_parser.h:40
std::map< std::string, std::string, std::less< void > > overrides
Definition: load_configs_parser.h:41
std::string base_dir
Definition: load_configs_parser.h:42
Definition: selector_common_parser.h:28