diff options
Diffstat (limited to 'src/zenutil/include')
| -rw-r--r-- | src/zenutil/include/zenutil/service.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/zenutil/include/zenutil/service.h b/src/zenutil/include/zenutil/service.h new file mode 100644 index 000000000..492e5c80a --- /dev/null +++ b/src/zenutil/include/zenutil/service.h @@ -0,0 +1,55 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include <zenbase/zenbase.h> + +#include <filesystem> +#include <optional> + +namespace zen { + +enum class ServiceLevel +{ + CurrentUser, + AllUsers, + SystemService +}; + +struct ServiceSpec +{ + std::filesystem::path ExecutablePath; + std::string CommandLineOptions; +#if ZEN_PLATFORM_WINDOWS + std::string DisplayName; + std::string Description; +#endif // ZEN_PLATFORM_WINDOWS +}; + +enum class ServiceStatus +{ + NotInstalled, + Starting, + Running, + Stopping, + Stopped, + Pausing, + Paused, + Resuming +}; + +struct ServiceInfo +{ + ServiceStatus Status; + ServiceSpec Spec; +}; + +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 |