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 <optional>
20#include <ostream>
21#include <string>
22#include <vector>
23
25
26namespace cuttlefish {
27
29 std::string target_directory;
30 std::vector<std::string> target_subdirectories;
34};
35
36struct CvdFlags {
37 std::vector<std::string> launch_cvd_flags;
38 std::vector<std::string> selector_flags;
39 std::vector<std::string> fetch_cvd_flags;
41 std::optional<std::string> group_name;
42 std::vector<std::string> instance_names;
43};
44
45struct Override {
46 std::string config_path;
47 std::string new_value;
48};
49
50std::ostream& operator<<(std::ostream& out, const Override& override);
51
52struct LoadFlags {
53 std::vector<Override> overrides;
54 std::string config_path;
55 std::string credential_source;
56 std::string project_id;
57 std::string base_dir;
58};
59
60Result<LoadFlags> GetFlags(std::vector<std::string>& args,
61 const std::string& working_directory);
62
64
65}; // namespace cuttlefish
Definition: expected.h:86
Definition: alloc_utils.cpp:23
Result< LoadFlags > GetFlags(std::vector< std::string > &args, const std::string &working_directory)
Definition: load_configs_parser.cpp:336
Result< CvdFlags > GetCvdFlags(const LoadFlags &flags)
Definition: load_configs_parser.cpp:378
std::ostream & operator<<(std::ostream &out, Arch arch)
Definition: architecture.cpp:67
Definition: load_configs_parser.h:36
LoadDirectories load_directories
Definition: load_configs_parser.h:40
std::vector< std::string > launch_cvd_flags
Definition: load_configs_parser.h:37
std::vector< std::string > instance_names
Definition: load_configs_parser.h:42
std::optional< std::string > group_name
Definition: load_configs_parser.h:41
std::vector< std::string > fetch_cvd_flags
Definition: load_configs_parser.h:39
std::vector< std::string > selector_flags
Definition: load_configs_parser.h:38
Definition: load_configs_parser.h:28
std::string launch_home_directory
Definition: load_configs_parser.h:31
std::vector< std::string > target_subdirectories
Definition: load_configs_parser.h:30
std::string system_image_directory_flag_value
Definition: load_configs_parser.h:33
std::string host_package_directory
Definition: load_configs_parser.h:32
std::string target_directory
Definition: load_configs_parser.h:29
Definition: load_configs_parser.h:52
std::string credential_source
Definition: load_configs_parser.h:55
std::vector< Override > overrides
Definition: load_configs_parser.h:53
std::string config_path
Definition: load_configs_parser.h:54
std::string project_id
Definition: load_configs_parser.h:56
std::string base_dir
Definition: load_configs_parser.h:57
Definition: load_configs_parser.h:45
std::string new_value
Definition: load_configs_parser.h:47
std::string config_path
Definition: load_configs_parser.h:46