Android-cuttlefish cvd tool
xdg.h
Go to the documentation of this file.
1//
2// Copyright (C) 2024 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
21#include "absl/strings/string_view.h"
22
24
25namespace cuttlefish {
26
27// See https://specifications.freedesktop.org/basedir-spec/latest/
28
29Result<std::string> CvdDataHome();
30Result<std::string> CvdConfigHome();
31Result<std::string> CvdStateHome();
32Result<std::string> CvdCacheHome();
33std::string CvdRuntimeDir();
34
35Result<std::vector<std::string>> CvdDataDirs();
36Result<std::vector<std::string>> CvdConfigDirs();
37
38Result<std::string> ReadCvdDataFile(absl::string_view path);
39Result<std::vector<std::string>> FindCvdDataFiles(absl::string_view path);
40Result<void> WriteCvdDataFile(absl::string_view path, std::string contents);
41
42// TODO: schuffelen - Decide between merging or overriding for config files
43
44} // namespace cuttlefish
Definition: alloc_driver.h:21
Result< std::vector< std::string > > FindCvdDataFiles(absl::string_view path)
Definition: xdg.cpp:137
Result< void > WriteCvdDataFile(absl::string_view path, std::string contents)
Definition: xdg.cpp:164
Result< std::string > ReadCvdDataFile(absl::string_view path)
Definition: xdg.cpp:126
Result< std::string > CvdDataHome()
Definition: xdg.cpp:92
Result< std::vector< std::string > > CvdConfigDirs()
Definition: xdg.cpp:118
Result< std::string > CvdStateHome()
Definition: xdg.cpp:100
Result< std::vector< std::string > > CvdDataDirs()
Definition: xdg.cpp:110
Result< std::string > CvdCacheHome()
Definition: xdg.cpp:104
Result< std::string > CvdConfigHome()
Definition: xdg.cpp:96
std::string CvdRuntimeDir()
Definition: xdg.cpp:108