Android-cuttlefish cvd tool
composite_disk.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 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 <stdint.h>
19
20#include <string>
21
22#include "cuttlefish/host/libs/image_aggregator/cdisk_spec.pb.h"
24#include "cuttlefish/io/io.h"
26
27namespace cuttlefish {
28
31 public:
33 static Result<CompositeDiskImage> OpenExisting(const std::string& path);
34
38
45 static std::string MagicString();
46
47 Result<uint64_t> VirtualSizeBytes() const override;
48
49 const CompositeDisk& GetCompositeDisk() const { return cdisk_; }
50
51 private:
52 CompositeDiskImage(CompositeDisk);
53 CompositeDisk cdisk_;
54};
55
56} // namespace cuttlefish
Definition: composite_disk.h:30
CompositeDiskImage & operator=(CompositeDiskImage &&)
Definition: composite_disk.cc:60
CompositeDisk cdisk_
Definition: composite_disk.h:53
static Result< CompositeDiskImage > OpenExisting(Reader &)
Definition: composite_disk.cc:41
CompositeDiskImage(CompositeDiskImage &&)
Definition: composite_disk.cc:56
const CompositeDisk & GetCompositeDisk() const
Definition: composite_disk.h:49
Result< uint64_t > VirtualSizeBytes() const override
Definition: composite_disk.cc:65
static std::string MagicString()
Definition: composite_disk.cc:54
Definition: disk_image.h:24
Definition: io.h:29
Definition: alloc_driver.h:20
tl::expected< T, StackTraceError > Result
Definition: result_type.h:30