Android-cuttlefish cvd tool
adb
sysdeps
env.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2020 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
17
#pragma once
18
19
#include <optional>
20
#include <string>
21
22
namespace
adb
{
23
namespace
sysdeps {
24
25
// Attempts to retrieve the environment variable value for |var|. Returns std::nullopt
26
// if unset.
27
std::optional<std::string>
GetEnvironmentVariableUTF8
(std::string_view var);
28
29
// Gets the host name of the system. Returns empty string on failure.
30
std::string
GetHostNameUTF8
();
31
// Gets the current login user. Returns empty string on failure.
32
std::string
GetLoginNameUTF8
();
33
34
}
// namespace sysdeps
35
}
// namespace adb
adb::sysdeps::GetHostNameUTF8
std::string GetHostNameUTF8()
Definition:
env.cpp:73
adb::sysdeps::GetLoginNameUTF8
std::string GetLoginNameUTF8()
Definition:
env.cpp:98
adb::sysdeps::GetEnvironmentVariableUTF8
std::optional< std::string > GetEnvironmentVariableUTF8(std::string_view var)
adb
Definition:
key.h:25
Generated by
1.9.4