aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.config/string.ccm
blob: ae5efb93ba4d2a012de4557312e0e95b3853fd88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * This source code is released into the public domain.
 */

module;

#include <format>
#include <string>

export module nihil.config:string;

import nihil.ucl;
import :option;

namespace nihil::config {

export struct string final : option
{
	string(std::string &storage,
	       std::string_view name,
	       std::string_view description) noexcept;

	~string();

	auto get_string() const -> std::string override;
	auto set_string(std::string_view new_value) -> void override;

	auto to_ucl() const -> ucl::object override;
	auto from_ucl(ucl::object const &uclobj) -> void override;

private:
	std::string &_storage;
};

} // namespace nihil::config