Prism Ruby parser
Loading...
Searching...
No Matches
options.hpp
Go to the documentation of this file.
1
6#ifndef PRISM_OPTIONS_HPP
7#define PRISM_OPTIONS_HPP
8
9#include "prism/compiler/cplusplus.hpp"
10
11#include "prism/options.h"
12
13#include <memory>
14
15namespace prism {
16
24 void operator()(pm_options_t *options) const noexcept { pm_options_free(options); }
25};
26
28using unique_options = std::unique_ptr<pm_options_t, options_deleter>;
29
36[[nodiscard]] inline unique_options
37make_options() noexcept {
39}
40
41}
42
43#endif
The options that can be passed to parsing.
struct pm_options_t pm_options_t
The options that can be passed to the parser.
Definition options.h:30
PRISM_NODISCARD PRISM_EXPORTED_FUNCTION pm_options_t * pm_options_new(void)
Allocate a new options struct.
PRISM_EXPORTED_FUNCTION void pm_options_free(pm_options_t *options) PRISM_NONNULL(1)
Free both the held memory of the given options struct and the struct itself.
std::unique_ptr< pm_options_t, options_deleter > unique_options
An owned set of options.
Definition options.hpp:28
unique_options make_options() noexcept
Allocate a new set of options with every option at its default.
Definition options.hpp:37
Frees options with pm_options_free.
Definition options.hpp:18
void operator()(pm_options_t *options) const noexcept
Free the given options.
Definition options.hpp:24