mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-03 23:00:58 +00:00 
			
		
		
		
	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 = {});
 | 
						|
};
 | 
						|
 | 
						|
}
 |