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
22
23namespace cuttlefish {
24
25// See https://specifications.freedesktop.org/basedir-spec/latest/
26
27Result<std::string> CvdDataHome();
28Result<std::string> CvdConfigHome();
29Result<std::string> CvdStateHome();
30Result<std::string> CvdCacheHome();
31std::string CvdRuntimeDir();
32
33Result<std::vector<std::string>> CvdDataDirs();
34Result<std::vector<std::string>> CvdConfigDirs();
35
36Result<std::string> ReadCvdDataFile(std::string_view path);
37Result<std::vector<std::string>> FindCvdDataFiles(std::string_view path);
38Result<void> WriteCvdDataFile(std::string_view path, std::string contents);
39
40// TODO: schuffelen - Decide between merging or overriding for config files
41
42} // namespace cuttlefish
Definition: alloc_utils.cpp:23
Result< std::string > CvdDataHome()
Definition: xdg.cpp:87
Result< std::string > ReadCvdDataFile(std::string_view path)
Definition: xdg.cpp:121
Result< std::vector< std::string > > CvdConfigDirs()
Definition: xdg.cpp:113
Result< std::vector< std::string > > FindCvdDataFiles(std::string_view path)
Definition: xdg.cpp:132
Result< std::string > CvdStateHome()
Definition: xdg.cpp:95
Result< std::vector< std::string > > CvdDataDirs()
Definition: xdg.cpp:105
Result< std::string > CvdCacheHome()
Definition: xdg.cpp:99
Result< std::string > CvdConfigHome()
Definition: xdg.cpp:91
std::string CvdRuntimeDir()
Definition: xdg.cpp:103
Result< void > WriteCvdDataFile(std::string_view path, std::string contents)
Definition: xdg.cpp:159