xtd 0.2.0
Loading...
Searching...
No Matches
format.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "string.hpp"
6#include "u8string.hpp"
7#include "u16string.hpp"
8#include "u32string.hpp"
9#include "wstring.hpp"
10
12namespace xtd {
19 template<typename ...args_t>
20 xtd::string format(const xtd::string& fmt, args_t&& ... args) {return xtd::string::format(fmt, std::forward<args_t>(args)...);}
21#if defined(__xtd__cpp_lib_char8_t)
28 template<typename ...args_t>
29 xtd::u8string format(const xtd::u8string& fmt, args_t&& ... args) {return xtd::string::format(fmt.to_string(), std::forward<args_t>(args)...);}
30#endif
37 template<typename ...args_t>
38 xtd::u16string format(const xtd::u16string& fmt, args_t&& ... args) {return xtd::string::format(fmt.to_string(), std::forward<args_t>(args)...);}
45 template<typename ...args_t>
46 xtd::u32string format(const xtd::u32string& fmt, args_t&& ... args) {return xtd::string::format(fmt.to_string(), std::forward<args_t>(args)...);}
53 template<typename ...args_t>
54 xtd::wstring format(const xtd::wstring& fmt, args_t&& ... args) {return xtd::string::format(fmt.to_string(), std::forward<args_t>(args)...);}
55
57 template<typename ...args_t>
58 xtd::string format(const char* fmt, args_t&& ... args) {return xtd::string::format(std::string {fmt}, std::forward<args_t>(args)...);}
59#if defined(__xtd__cpp_lib_char8_t)
60 template<typename ...args_t>
61 xtd::u8string format(const char8_t* fmt, args_t&& ... args) {return xtd::string::format(std::u8string {fmt}, std::forward<args_t>(args)...);}
62#endif
63 template<typename ...args_t>
64 xtd::u16string format(const char16_t* fmt, args_t&& ... args) {return xtd::string::format(std::u16string {fmt}, std::forward<args_t>(args)...);}
65 template<typename ...args_t>
66 xtd::u32string format(const char32_t* fmt, args_t&& ... args) {return xtd::string::format(std::u32string {fmt}, std::forward<args_t>(args)...);}
67 template<typename ...args_t>
68 xtd::wstring format(const wchar_t* fmt, args_t&& ... args) {return xtd::string::format(std::wstring {fmt}, std::forward<args_t>(args)...);}
70}
Represents text as a sequence of character units.
Definition basic_string.hpp:79
basic_string< char > to_string() const noexcept override
Converts the value of this instance to a xtd::basic_string <char>.
Definition basic_string.hpp:1919
static basic_string format(const basic_string< char > &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
xtd::string format(const xtd::string &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to string using the specified format ...
Definition format.hpp:20
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::string alias.
Contains xtd::u16string alias.
Contains xtd::u32string alias.
Contains xtd::u8string alias.
Contains xtd::wstring alias.