Android-cuttlefish cvd tool
esp_builder.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#pragma once
17
18#include <string>
19#include <vector>
20
21namespace cuttlefish {
22
23class EspBuilder final {
24 public:
25 EspBuilder();
26 EspBuilder(std::string image_path);
27
28 EspBuilder& File(std::string from, std::string to, bool required) &;
29 EspBuilder& File(std::string from, std::string to) &;
30 EspBuilder& Directory(std::string path) &;
31 EspBuilder& Merge(EspBuilder builder) &;
32
33 bool Build();
34
35 private:
36 const std::string image_path_;
37
38 struct FileToAdd {
39 std::string from;
40 std::string to;
42 };
43 std::vector<std::string> directories_;
44 std::vector<FileToAdd> files_;
45};
46
47} // namespace cuttlefish
Definition: esp_builder.h:23
EspBuilder & Directory(std::string path) &
Definition: esp_builder.cc:70
std::vector< std::string > directories_
Definition: esp_builder.h:43
const std::string image_path_
Definition: esp_builder.h:36
bool Build()
Definition: esp_builder.cc:83
EspBuilder & Merge(EspBuilder builder) &
Definition: esp_builder.cc:75
EspBuilder & File(std::string from, std::string to, bool required) &
Definition: esp_builder.cc:60
std::vector< FileToAdd > files_
Definition: esp_builder.h:44
EspBuilder()
Definition: esp_builder.cc:56
Definition: alloc_driver.h:20
Definition: esp_builder.h:38
std::string from
Definition: esp_builder.h:39
bool required
Definition: esp_builder.h:41
std::string to
Definition: esp_builder.h:40