mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
3fc0350caf
This makes the wrapper more like the rest in LibCore, and also removes the annoying limitation of not supporting arguments. There are three overloads one for String, char const *, and StringView argument lists. As long as there are <= 10 arguments the argv list will be allocated inline, otherwise on the heap.
22 lines
526 B
C++
22 lines
526 B
C++
/*
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
* Copyright (c) 2022, MacDue <macdue@dueutil.tech>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Forward.h>
|
|
#include <AK/Span.h>
|
|
|
|
namespace Core {
|
|
|
|
class Process {
|
|
public:
|
|
static ErrorOr<pid_t> spawn(StringView path, Span<String const> arguments);
|
|
static ErrorOr<pid_t> spawn(StringView path, Span<StringView const> arguments);
|
|
static ErrorOr<pid_t> spawn(StringView path, Span<char const* const> arguments = {});
|
|
};
|
|
|
|
}
|