xtd 0.2.0
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<class ...args_t>
20 xtd::string format(const xtd::string& fmt, args_t&& ... args) {return xtd::string::format(fmt, std::forward<args_t>(args)...);}
27 template<class ...args_t>
28 xtd::u8string format(const xtd::u8string& fmt, args_t&& ... args) {return xtd::string::format(fmt.to_string(), std::forward<args_t>(args)...);}
35 template<class ...args_t>
36 xtd::u16string format(const xtd::u16string& fmt, args_t&& ... args) {return xtd::string::format(fmt.to_string(), std::forward<args_t>(args)...);}
43 template<class ...args_t>
44 xtd::u32string format(const xtd::u32string& fmt, args_t&& ... args) {return xtd::string::format(fmt.to_string(), std::forward<args_t>(args)...);}
51 template<class ...args_t>
52 xtd::wstring format(const xtd::wstring& fmt, args_t&& ... args) {return xtd::string::format(fmt.to_string(), std::forward<args_t>(args)...);}
53
55 template<class ...args_t>
56 xtd::string format(const char* fmt, args_t&& ... args) {return xtd::string::format(std::string {fmt}, std::forward<args_t>(args)...);}
57 template<class ...args_t>
58 xtd::u8string format(const char8_t* fmt, args_t&& ... args) {return xtd::string::format(std::u8string {fmt}, std::forward<args_t>(args)...);}
59 template<class ...args_t>
60 xtd::u16string format(const char16_t* fmt, args_t&& ... args) {return xtd::string::format(std::u16string {fmt}, std::forward<args_t>(args)...);}
61 template<class ...args_t>
62 xtd::u32string format(const char32_t* fmt, args_t&& ... args) {return xtd::string::format(std::u32string {fmt}, std::forward<args_t>(args)...);}
63 template<class ...args_t>
64 xtd::wstring format(const wchar_t* fmt, args_t&& ... args) {return xtd::string::format(std::wstring {fmt}, std::forward<args_t>(args)...);}
66}
virtual xtd::string to_string() const noexcept
Returns a xtd::string that represents the current object.
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
xtd::basic_string< xtd::char8 > u8string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:76
xtd::basic_string< xtd::char32 > u32string
Represents text as a sequence of UTF-32 code units.
Definition __string_definitions.hpp:65
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
xtd::basic_string< xtd::char16 > u16string
Represents text as a sequence of UTF-16 code units.
Definition __string_definitions.hpp:54
xtd::basic_string< xtd::wchar > wstring
Represents text as a sequence of UTF-16 code unit on Windows or UTF-32 code unit on non-Windows syste...
Definition __string_definitions.hpp:87
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::string alias.
Contains xtd::u16string alias.
Contains xtd::u32string alias.
Contains xtd::u8string alias.
Contains xtd::wstring alias.