Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
session_bus.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <optional>
8#include <string>
9#include <string_view>
10
11namespace platf::session_bus {
12
31 inline std::optional<std::string> with_private_bus(std::string_view command, bool has_bus, std::string_view dbus_run_session) {
32 if (has_bus) {
33 return std::string {command};
34 }
35 if (dbus_run_session.empty() || dbus_run_session.find_first_of(" \t\n'\"\\") != std::string_view::npos) {
36 return std::nullopt;
37 }
38 return std::string {dbus_run_session} + " -- " + std::string {command};
39 }
40
41} // namespace platf::session_bus
std::optional< std::string > with_private_bus(std::string_view command, bool has_bus, std::string_view dbus_run_session)
The command that starts an isolated session with a session bus of its own.
Definition session_bus.h:31