xtd 0.2.0
sprintf.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 {
72 template<class ...args_t>
73 xtd::string sprintf(const xtd::string& fmt, args_t&& ... args) {return xtd::string::sprintf(fmt, std::forward<args_t>(args)...);}
74#if defined(__xtd__cpp_lib_char8_t)
134 template<class ...args_t>
135 xtd::u8string sprintf(const xtd::u8string& fmt, args_t&& ... args) {return xtd::string::sprintf(fmt.to_string(), std::forward<args_t>(args)...);}
136#endif
196 template<class ...args_t>
197 xtd::u16string sprintf(const xtd::u16string& fmt, args_t&& ... args) {return xtd::string::sprintf(fmt.to_string(), std::forward<args_t>(args)...);}
257 template<class ...args_t>
258 xtd::u32string sprintf(const xtd::u32string& fmt, args_t&& ... args) {return xtd::string::sprintf(fmt.to_string(), std::forward<args_t>(args)...);}
318 template<class ...args_t>
319 xtd::wstring sprintf(const xtd::wstring& fmt, args_t&& ... args) {return xtd::string::sprintf(fmt.to_string(), std::forward<args_t>(args)...);}
320
322 template<class ...args_t>
323 xtd::string sprintf(const char* fmt, args_t&& ... args) {return xtd::string::sprintf(std::string {fmt}, std::forward<args_t>(args)...);}
324#if defined(__xtd__cpp_lib_char8_t)
325 template<class ...args_t>
326 xtd::u8string sprintf(const char8_t* fmt, args_t&& ... args) {return xtd::string::sprintf(std::u8string {fmt}, std::forward<args_t>(args)...);}
327#endif
328 template<class ...args_t>
329 xtd::u16string sprintf(const char16_t* fmt, args_t&& ... args) {return xtd::string::sprintf(std::u16string {fmt}, std::forward<args_t>(args)...);}
330 template<class ...args_t>
331 xtd::u32string sprintf(const char32_t* fmt, args_t&& ... args) {return xtd::string::sprintf(std::u32string {fmt}, std::forward<args_t>(args)...);}
332 template<class ...args_t>
333 xtd::wstring sprintf(const wchar_t* fmt, args_t&& ... args) {return xtd::string::sprintf(std::wstring {fmt}, std::forward<args_t>(args)...);}
335}
Represents text as a sequence of character units.
Definition basic_string.hpp:71
basic_string< char > to_string() const noexcept override
Converts the value of this instance to a xtd::basic_string <char>.
Definition basic_string.hpp:1911
static basic_string sprintf(const basic_string &fmt, args_t &&... args) noexcept
Writes the text representation of the specified arguments list, to basic_string using the specified f...
Definition basic_string.hpp:2402
xtd::string sprintf(const xtd::string &fmt, args_t &&... args)
Writes the text representation of the specified arguments list, to basic_string using the specified f...
Definition sprintf.hpp:73
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.