/**
This file is a part of rexy's general purpose library
Copyright (C) 2022 rexy712
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
#ifndef REXY_FORMAT_HPP
#define REXY_FORMAT_HPP
#include "string.hpp"
#include "string_view.hpp"
#include "compat/standard.hpp"
REXY_REQUIRES_CPP20;
#ifndef REXY_STANDARD_CPP20
//Maybe I'll make it work someday, but not for now
#error "Cannot use formatting library without C++20 support"
#endif
#include "detail/format/standard_types.hpp"
#include "detail/format/internal_types.hpp"
#include "detail/format/arg_store.hpp"
#include "detail/format/format_string.hpp"
#include "detail/format/format_args.hpp"
#include //FILE
#include //size_t
#include //locale
namespace rexy{
//Alias declarations of standard defined types
using format_context = fmt::detail::fmt_context_t;
using wformat_context = fmt::detail::fmt_context_t;
using parse_context = fmt::detail::parse_context_t;
using wparse_context = fmt::detail::parse_context_t;
using format_arg = fmt::basic_format_arg;
using wformat_arg = fmt::basic_format_arg;
using format_args = fmt::basic_format_args;
using wformat_args = fmt::basic_format_args;
template
fmt::detail::basic_format_arg_store make_format_args(Args&&... args);
template
fmt::detail::basic_format_arg_store make_wformat_args(Args&&... args);
template
OutIt vformat_to(OutIt out, string_view fmt, format_args args);
template
OutIt vformat_to(OutIt out, const std::locale& loc, string_view fmt, wformat_args args);
string vformat(string_view fmt, format_args args);
string vformat(const std::locale& loc, string_view fmt, format_args args);
template
OutIt format_to(OutIt out, fmt::detail::format_string fmt, Args&&... args);
template
OutIt format_to(OutIt out, const std::locale& loc, fmt::detail::format_string fmt, Args&&... args);
template
format_to_n_result format_to_n(OutIt out, std::size_t max, fmt::detail::format_string fmt, Args&&... args);
template
format_to_n_result format_to_n(OutIt out, const std::locale& loc, std::size_t max, fmt::detail::format_string fmt, Args&&... args);
template
string format(fmt::detail::format_string fmt, Args&&... args);
template
string format(const std::locale& loc, fmt::detail::format_string fmt, Args&&... args);
template
std::size_t formatted_size(fmt::detail::format_string fmt, Args&&... args);
template
std::size_t formatted_size(const std::locale& loc, fmt::detail::format_string fmt, Args&&... args);
template
OutIt vformat_to(OutIt out, wstring_view fmt, wformat_args args);
template
OutIt vformat_to(OutIt out, const std::locale& loc, wstring_view fmt, wformat_args args);
wstring vformat(wstring_view fmt, format_args args);
wstring vformat(const std::locale& loc, wstring_view fmt, wformat_args args);
template
OutIt format_to(OutIt out, fmt::detail::wformat_string fmt, Args&&... args);
template
OutIt format_to(OutIt out, const std::locale& loc, fmt::detail::wformat_string fmt, Args&&... args);
template
format_to_n_result format_to_n(OutIt out, std::size_t max, fmt::detail::wformat_string fmt, Args&&... args);
template
format_to_n_result format_to_n(OutIt out, const std::locale& loc, std::size_t max, fmt::detail::wformat_string fmt, Args&&... args);
template
wstring format(fmt::detail::wformat_string fmt, Args&&... args);
template
wstring format(const std::locale& loc, fmt::detail::wformat_string fmt, Args&&... args);
template
std::size_t formatted_size(fmt::detail::wformat_string fmt, Args&&... args);
template
std::size_t formatted_size(const std::locale& loc, fmt::detail::wformat_string fmt, Args&&... args);
template
std::size_t print(fmt::detail::format_string fmt, Args&&... args);
template
std::size_t print(FILE* stream, fmt::detail::format_string fmt, Args&&... args);
template
std::size_t println(fmt::detail::format_string fmt, Args&&... args);
template
std::size_t println(FILE* stream, fmt::detail::format_string fmt, Args&&... args);
std::size_t vprint_unicode(string_view fmt, format_args args);
std::size_t vprint_unicode(FILE* stream, string_view fmt, format_args args);
template
constexpr auto arg(const Char* name, T&& t);
template
constexpr auto arg(rexy::basic_string_view name, T&& t);
template
constexpr auto arg(T&& t);
inline namespace fmt_literals{
template
constexpr auto operator""_a(void);
}
}
#include "format.tpp"
#endif