Core: Add initial process support (Process::SpawnDetached)
This commit is contained in:
committed by
Jérôme Leclercq
parent
278e59934b
commit
ac1422c221
37
include/Nazara/Core/Process.hpp
Normal file
37
include/Nazara/Core/Process.hpp
Normal file
@@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
|
||||
// This file is part of the "Nazara Engine - Core module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_CORE_PROCESS_HPP
|
||||
#define NAZARA_CORE_PROCESS_HPP
|
||||
|
||||
#include <NazaraUtils/Prerequisites.hpp>
|
||||
#include <Nazara/Core/Config.hpp>
|
||||
#include <NazaraUtils/Result.hpp>
|
||||
#include <filesystem>
|
||||
#include <span>
|
||||
#include <string>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
using Pid = UInt32;
|
||||
|
||||
class NAZARA_CORE_API Process
|
||||
{
|
||||
public:
|
||||
Process() = default;
|
||||
Process(const Process&) = delete;
|
||||
Process(Process&&) = delete;
|
||||
~Process() = default;
|
||||
|
||||
Process& operator=(const Process&) = delete;
|
||||
Process& operator=(Process&&) = delete;
|
||||
|
||||
static Result<Pid, std::string> SpawnDetached(const std::filesystem::path& program, std::span<const std::string> arguments = {}, const std::filesystem::path& workingDirectory = {}); };
|
||||
}
|
||||
|
||||
#include <Nazara/Core/Process.inl>
|
||||
|
||||
#endif // NAZARA_CORE_PROCESS_HPP
|
||||
Reference in New Issue
Block a user