diff options
| author | Dan Engelbrecht <[email protected]> | 2024-08-28 14:40:03 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2025-01-08 10:01:23 +0100 |
| commit | 54ffc9b9ad7d3d8d32e4de00980d66d4a31f3c09 (patch) | |
| tree | 457c7c404bdbe7486e37bd8c699ed5716c7513e0 /src/zenutil/include | |
| parent | clang format (diff) | |
| download | zen-54ffc9b9ad7d3d8d32e4de00980d66d4a31f3c09.tar.xz zen-54ffc9b9ad7d3d8d32e4de00980d66d4a31f3c09.zip | |
Add ServiceSpec struct
Diffstat (limited to 'src/zenutil/include')
| -rw-r--r-- | src/zenutil/include/zenutil/service.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/zenutil/include/zenutil/service.h b/src/zenutil/include/zenutil/service.h index 79be16052..cd769b67b 100644 --- a/src/zenutil/include/zenutil/service.h +++ b/src/zenutil/include/zenutil/service.h @@ -5,6 +5,15 @@ #include <filesystem> namespace zen { + +struct ServiceSpec +{ + std::filesystem::path ExecutablePath; + std::string CommandLineOptions; + std::string DisplayName; + std::string Description; +}; + enum class ServiceStatus { NotInstalled, @@ -17,22 +26,17 @@ enum class ServiceStatus Resuming }; -std::string_view ToString(ServiceStatus Status); - -std::error_code InstallService(const std::filesystem::path& ExecutablePath, - std::string_view CommandLineOptions, - std::string_view ServiceName, - std::string_view ServiceDisplayName, - std::string_view ServiceDescription); -std::error_code UninstallService(std::string_view ServiceName); struct ServiceInfo { - ServiceStatus Status; - std::filesystem::path ExecutablePath; - std::string DisplayName; - std::string Description; + ServiceStatus Status; + ServiceSpec Spec; }; -std::error_code QueryInstalledService(std::string_view ServiceName, ServiceInfo& OutStatus); + +std::string_view ToString(ServiceStatus Status); + +std::error_code InstallService(std::string_view ServiceName, const ServiceSpec& Spec); +std::error_code UninstallService(std::string_view ServiceName); +std::error_code QueryInstalledService(std::string_view ServiceName, ServiceInfo& OutInfo); std::error_code StartService(std::string_view ServiceName); std::error_code StopService(std::string_view ServiceName); } // namespace zen |