summaryrefslogtreecommitdiff
path: root/src/format_ext.hpp
blob: e0084e2fd4e64af37f1d74b3fe5192be68288c52 (plain)
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
#include <utility>

#pragma once

#include <fmt/format.h>
#include <string>

struct singular_prefix {

private:
	std::string m_s;

	friend void format_arg(fmt::BasicFormatter<char> &formatter, const char *&format_str, const singular_prefix &sp);

public:
	explicit singular_prefix(std::string s)
		: m_s(std::move(s))
	{
	}

	explicit singular_prefix(std::string &&s)
		: m_s(std::move(s))
	{
	}

	void write(fmt::Writer &w) const;

};

//
// Formatting support for fmtlib
//
void format_arg(fmt::BasicFormatter<char> &formatter, const char *&format_str, const singular_prefix &sp);