Android-cuttlefish cvd tool
android_build_string.h
Go to the documentation of this file.
1//
2// Copyright (C) 2023 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#pragma once
17
18#include <optional>
19#include <string>
20#include <variant>
21#include <vector>
22
23#include "absl/strings/string_view.h"
24
31
32namespace cuttlefish {
33
36
37std::ostream& operator<<(std::ostream& out, const BuildString& build_string);
38
39std::ostream& operator<<(std::ostream& out,
40 const std::optional<BuildString>& build_string);
41
42std::optional<std::string> GetFilepath(const BuildString& build_string);
43
44void SetFilepath(BuildString& build_string, const std::string& value);
45
46Result<BuildString> ParseBuildString(absl::string_view build_string);
47
48Flag GflagsCompatFlag(const std::string& name,
49 std::optional<BuildString>& value);
50Flag GflagsCompatFlag(const std::string& name,
51 std::vector<std::optional<BuildString>>& value);
52
53BuildString WithFallbackTarget(BuildString build_string, std::string fallback);
54
55} // namespace cuttlefish
Definition: flag.h:33
Definition: alloc_driver.h:21
Flag GflagsCompatFlag(const std::string &name, std::string &value)
Definition: gflags_compat.cpp:280
std::variant< DeviceBuildString, DirectoryBuildString, GcsBuildString, HttpBuildString > BuildString
Definition: android_build_string.h:35
Result< BuildString > ParseBuildString(absl::string_view build_string)
Definition: android_build_string.cc:67
BuildString WithFallbackTarget(BuildString build_string, std::string fallback)
Definition: android_build_string.cc:157
std::ostream & operator<<(std::ostream &out, DeviceType device_type)
Definition: device_type.cpp:73
std::optional< std::string > GetFilepath(const Build &build)
Definition: android_build.cc:233
void SetFilepath(BuildString &build_string, const std::string &value)
Definition: android_build_string.cc:63
tl::expected< T, StackTraceError< E > > Result
Definition: result_type.h:30
Definition: device_build_string.h:25
Definition: directory_build_string.h:24
Definition: gcs_build_string.h:26
Definition: http_build_string.h:26