xtd 0.2.0
Loading...
Searching...
No Matches
convert_string.h
Go to the documentation of this file.
1
4#pragma once
5#include "static.h"
6#include "string.h"
7#define __XTD_STD_INTERNAL__
9#undef __XTD_STD_INTERNAL__
10
12namespace xtd {
28 public:
30
42 static const std::string& to_string(const std::string& str) noexcept;
53 static std::string to_string(const char* str) noexcept;
64 static std::string to_string(char* str) noexcept;
75 static std::string to_string(const xtd::string& str) noexcept;
76#if defined(__xtd__cpp_lib_char8_t)
87 static std::string to_string(const std::u8string& str) noexcept;
98 static std::string to_string(const char8* str) noexcept;
109 static std::string to_string(char8* str) noexcept;
110#endif
121 static std::string to_string(const std::u16string& str) noexcept;
132 static std::string to_string(const char16* str) noexcept;
143 static std::string to_string(char16* str) noexcept;
154 static std::string to_string(const std::u32string& str) noexcept;
165 static std::string to_string(const char32* str) noexcept;
176 static std::string to_string(char32* str) noexcept;
187 static std::string to_string(const std::wstring& str) noexcept;
198 static std::string to_string(const wchar* str) noexcept;
209 static std::string to_string(wchar* str) noexcept;
210
221 static xtd::string to_ustring(const std::string& str) noexcept;
232 static xtd::string to_ustring(const char* str) noexcept;
243 static xtd::string to_ustring(char* str) noexcept;
254 static const xtd::string& to_ustring(const xtd::string& str) noexcept;
255#if defined(__xtd__cpp_lib_char8_t)
266 static xtd::string to_ustring(const std::u8string& str) noexcept;
277 static xtd::string to_ustring(const char8* str) noexcept;
288 static xtd::string to_ustring(char8* str) noexcept;
289#endif
300 static xtd::string to_ustring(const std::u16string& str) noexcept;
311 static xtd::string to_ustring(const char16* str) noexcept;
321 static xtd::string to_ustring(char16* str) noexcept;
332 static xtd::string to_ustring(const std::u32string& str) noexcept;
342 static xtd::string to_ustring(const char32* str) noexcept;
352 static xtd::string to_ustring(char32* str) noexcept;
363 static xtd::string to_ustring(const std::wstring& str) noexcept;
373 static xtd::string to_ustring(const wchar* str) noexcept;
383 static xtd::string to_ustring(wchar* str) noexcept;
384
385#if defined(__xtd__cpp_lib_char8_t)
396 static std::u8string to_u8string(const std::string& str) noexcept;
406 static std::u8string to_u8string(const char* str) noexcept;
416 static std::u8string to_u8string(char* str) noexcept;
427 static std::u8string to_u8string(const xtd::string& str) noexcept;
428#if defined(__xtd__cpp_lib_char8_t)
439 static const std::u8string& to_u8string(const std::u8string& str) noexcept;
449 static std::u8string to_u8string(const char8* str) noexcept;
455 static std::u8string to_u8string(char8* str) noexcept;
456#endif
467 static std::u8string to_u8string(const std::u16string& str) noexcept;
477 static std::u8string to_u8string(const char16* str) noexcept;
487 static std::u8string to_u8string(char16* str) noexcept;
498 static std::u8string to_u8string(const std::u32string& str) noexcept;
508 static std::u8string to_u8string(const char32* str) noexcept;
518 static std::u8string to_u8string(char32* str) noexcept;
529 static std::u8string to_u8string(const std::wstring& str) noexcept;
539 static std::u8string to_u8string(const wchar* str) noexcept;
549 static std::u8string to_u8string(wchar* str) noexcept;
550#endif
551
562 static std::u16string to_u16string(const std::string& str) noexcept;
572 static std::u16string to_u16string(const char* str) noexcept;
582 static std::u16string to_u16string(char* str) noexcept;
593 static std::u16string to_u16string(const xtd::string& str) noexcept;
594#if defined(__xtd__cpp_lib_char8_t)
607 static std::u16string to_u16string(const std::u8string& str) noexcept;
617 static std::u16string to_u16string(const char8* str) noexcept;
627 static std::u16string to_u16string(char8* str) noexcept;
628#endif
639 static const std::u16string& to_u16string(const std::u16string& str) noexcept;
649 static std::u16string to_u16string(const char16* str) noexcept;
659 static std::u16string to_u16string(char16* str) noexcept;
670 static std::u16string to_u16string(const std::u32string& str) noexcept;
680 static std::u16string to_u16string(const char32* str) noexcept;
690 static std::u16string to_u16string(char32* str) noexcept;
701 static std::u16string to_u16string(const std::wstring& str) noexcept;
711 static std::u16string to_u16string(const wchar* str) noexcept;
721 static std::u16string to_u16string(wchar* str) noexcept;
722
733 static std::u32string to_u32string(const std::string& str) noexcept;
743 static std::u32string to_u32string(const char* str) noexcept;
753 static std::u32string to_u32string(char* str) noexcept;
764 static std::u32string to_u32string(const xtd::string& str) noexcept;
765#if defined(__xtd__cpp_lib_char8_t)
776 static std::u32string to_u32string(const std::u8string& str) noexcept;
786 static std::u32string to_u32string(const char8* str) noexcept;
796 static std::u32string to_u32string(char8* str) noexcept;
797#endif
808 static std::u32string to_u32string(const std::u16string& str) noexcept;
818 static std::u32string to_u32string(const char16* str) noexcept;
828 static std::u32string to_u32string(char16* str) noexcept;
839 static const std::u32string& to_u32string(const std::u32string& str) noexcept;
849 static std::u32string to_u32string(const char32* str) noexcept;
859 static std::u32string to_u32string(char32* str) noexcept;
870 static std::u32string to_u32string(const std::wstring& str) noexcept;
880 static std::u32string to_u32string(const wchar* str) noexcept;
890 static std::u32string to_u32string(wchar* str) noexcept;
891
902 static std::wstring to_wstring(const std::string& str) noexcept;
912 static std::wstring to_wstring(const char* str) noexcept;
922 static std::wstring to_wstring(char* str) noexcept;
933 static std::wstring to_wstring(const xtd::string& str) noexcept;
934#if defined(__xtd__cpp_lib_char8_t)
945 static std::wstring to_wstring(const std::u8string& str) noexcept;
955 static std::wstring to_wstring(const char8* str) noexcept;
965 static std::wstring to_wstring(char8* str) noexcept;
966#endif
977 static std::wstring to_wstring(const std::u16string& str) noexcept;
987 static std::wstring to_wstring(const char16* str) noexcept;
997 static std::wstring to_wstring(char16* str) noexcept;
1008 static std::wstring to_wstring(const std::u32string& str) noexcept;
1018 static std::wstring to_wstring(const char32* str) noexcept;
1028 static std::wstring to_wstring(char32* str) noexcept;
1039 static const std::wstring& to_wstring(const std::wstring& str) noexcept;
1049 static std::wstring to_wstring(const wchar* str) noexcept;
1059 static std::wstring to_wstring(wchar* str) noexcept;
1061 };
1062}
Contains __xtd_std_version definitions.
Represents text as a sequence of character units.
Definition basic_string.h:79
Represents API to convert string containers.
Definition convert_string.h:27
static const std::u32string & to_u32string(const std::u32string &str) noexcept
Converts std::u32string to std::u32string.
static const std::u16string & to_u16string(const std::u16string &str) noexcept
Converts std::u16string to std::u16string.
static std::u8string to_u8string(const xtd::string &str) noexcept
Converts xtd::string to std::u8string.
static std::wstring to_wstring(char *str) noexcept
Converts char* to std::wstring.
static xtd::string to_ustring(const char32 *str) noexcept
Converts const char32* to xtd::string.
static std::wstring to_wstring(const char *str) noexcept
Converts const char* to std::wstring.
static std::u8string to_u8string(const char16 *str) noexcept
Converts const char16* to std::u8string.
static std::u8string to_u8string(const std::u32string &str) noexcept
Converts std::u32string to std::u8string.
static std::u32string to_u32string(char32 *str) noexcept
Converts char32* to std::u32string.
static std::wstring to_wstring(const xtd::string &str) noexcept
Converts xtd::string to std::wstring.
static std::u32string to_u32string(const std::string &str) noexcept
Converts std::string to std::u32string.
static xtd::string to_ustring(char *str) noexcept
Converts char* to xtd::string.
static std::u8string to_u8string(const std::string &str) noexcept
Converts std::string to std::u8string.
static xtd::string to_ustring(char8 *str) noexcept
Converts char8* to xtd::string.
static std::u16string to_u16string(const std::u8string &str) noexcept
Converts std::u8string to std::u16string.
static std::u32string to_u32string(const char32 *str) noexcept
Converts const char32* to std::u32string.
static xtd::string to_ustring(char32 *str) noexcept
Converts char32* to xtd::string.
static std::string to_string(wchar *str) noexcept
Converts wchar* to std::string.
static xtd::string to_ustring(const char8 *str) noexcept
Converts const char8* to xtd::string.
static std::u16string to_u16string(const xtd::string &str) noexcept
Converts xtd::string to std::u16string.
static const std::u8string & to_u8string(const std::u8string &str) noexcept
Converts std::u8string to std::u8string.
static xtd::string to_ustring(const std::string &str) noexcept
Converts std::string to xtd::string.
static std::u8string to_u8string(const std::u16string &str) noexcept
Converts std::u16string to std::u8string.
static std::u16string to_u16string(const std::wstring &str) noexcept
Converts std::wstring to std::u16string.
static std::string to_string(const std::u16string &str) noexcept
Converts std::u16string to std::string.
static std::u8string to_u8string(char8 *str) noexcept
Converts char8* to std::u8string.
static std::u16string to_u16string(const char32 *str) noexcept
Converts const char32* to std::u16string.
static std::u32string to_u32string(const xtd::string &str) noexcept
Converts xtd::string to std::u32string.
static xtd::string to_ustring(const wchar *str) noexcept
Converts const wchar* to xtd::string.
static std::wstring to_wstring(const char32 *str) noexcept
Converts const char32* to std::wstring.
static std::wstring to_wstring(char16 *str) noexcept
Converts char16* to std::wstring.
static std::u8string to_u8string(char32 *str) noexcept
Converts char32* to std::u8string.
static std::u8string to_u8string(const wchar *str) noexcept
Converts const wchar* to std::u8string.
static xtd::string to_ustring(const std::u32string &str) noexcept
Converts std::u32string to xtd::string.
static xtd::string to_ustring(const char16 *str) noexcept
Converts const char16* to xtd::string.
static std::string to_string(char8 *str) noexcept
Converts char8* to std::string.
static std::u8string to_u8string(wchar *str) noexcept
Converts wchar* to std::u8string.
static std::u32string to_u32string(const char *str) noexcept
Converts const char* to std::u32string.
static xtd::string to_ustring(const std::wstring &str) noexcept
Converts std::wstring to xtd::string.
static xtd::string to_ustring(wchar *str) noexcept
Converts wchar* to xtd::string.
static std::u16string to_u16string(char8 *str) noexcept
Converts char8* to std::u16string.
static std::u16string to_u16string(char *str) noexcept
Converts char* to std::u16string.
static std::string to_string(char16 *str) noexcept
Converts char16* to std::string.
static std::string to_string(const std::u32string &str) noexcept
Converts std::u32string to std::string.
static std::string to_string(const xtd::string &str) noexcept
Converts xtd::string to std::string.
static std::u16string to_u16string(char16 *str) noexcept
Converts char16* to std::u16string.
static std::string to_string(const char16 *str) noexcept
Converts const char16* to std::string.
static std::u16string to_u16string(const wchar *str) noexcept
Converts const wchar* to std::u16string.
static std::u8string to_u8string(const char *str) noexcept
Converts const char* to std::u8string.
static std::string to_string(const char8 *str) noexcept
Converts const char8* to std::string.
static std::wstring to_wstring(wchar *str) noexcept
Converts wchar* to std::wstring.
static std::u32string to_u32string(wchar *str) noexcept
Converts wchar* to std::u32string.
static std::u32string to_u32string(char8 *str) noexcept
Converts char8* to std::u32string.
static std::u16string to_u16string(wchar *str) noexcept
Converts wchar* to std::u16string.
static std::u32string to_u32string(const std::wstring &str) noexcept
Converts std::wstring to std::u32string.
static std::wstring to_wstring(const char8 *str) noexcept
Converts const char8* to std::wstring.
static std::u32string to_u32string(char *str) noexcept
Converts char* to std::u32string.
static std::u16string to_u16string(char32 *str) noexcept
Converts char32* to std::u16string.
static std::u16string to_u16string(const std::u32string &str) noexcept
Converts std::u32string to std::u16string.
static std::u32string to_u32string(const wchar *str) noexcept
Converts const wchar* to std::u32string.
static std::string to_string(const wchar *str) noexcept
Converts const wchar* to std::string.
static std::u32string to_u32string(const std::u8string &str) noexcept
Converts std::u8string to std::u32string.
static const xtd::string & to_ustring(const xtd::string &str) noexcept
Converts xtd::string to xtd::string.
static std::wstring to_wstring(const std::u32string &str) noexcept
Converts std::u32string to std::wstring.
static std::u16string to_u16string(const char16 *str) noexcept
Converts const char16* to std::u16string.
static std::u8string to_u8string(char *str) noexcept
Converts char* to std::u8string.
static std::string to_string(const char32 *str) noexcept
Converts const char32* to std::string.
static std::string to_string(char *str) noexcept
Converts char* to std::string.
static xtd::string to_ustring(const char *str) noexcept
Converts const char* to xtd::string.
static std::wstring to_wstring(const std::u8string &str) noexcept
Converts std::u8string to std::wstring.
static std::u32string to_u32string(const std::u16string &str) noexcept
Converts std::u16string to std::u32string.
static xtd::string to_ustring(const std::u16string &str) noexcept
Converts std::u16string to xtd::string.
static std::u8string to_u8string(const char32 *str) noexcept
Converts const char32* to std::u8string.
static std::wstring to_wstring(const wchar *str) noexcept
Converts const wchar* to std::wstring.
static std::u16string to_u16string(const char8 *str) noexcept
Converts const char8* to std::u16string.
static std::string to_string(const std::wstring &str) noexcept
Converts std::wstring to std::string.
static std::u32string to_u32string(char16 *str) noexcept
Converts char16* to std::u32string.
static std::string to_string(const char *str) noexcept
Converts const char* to std::string.
static std::u8string to_u8string(char16 *str) noexcept
Converts char16* to std::u8string.
static std::wstring to_wstring(const std::u16string &str) noexcept
Converts std::u16string to std::wstring.
static std::string to_string(char32 *str) noexcept
Converts char32* to std::string.
static const std::string & to_string(const std::string &str) noexcept
Converts std::string to std::string.
static std::u16string to_u16string(const std::string &str) noexcept
Converts std::string to std::u16string.
static std::u8string to_u8string(const char8 *str) noexcept
Converts const char8* to std::u8string.
static xtd::string to_ustring(const std::u8string &str) noexcept
Converts std::u8string to xtd::string.
static std::u32string to_u32string(const char16 *str) noexcept
Converts const char16* to std::u32string.
static const std::wstring & to_wstring(const std::wstring &str) noexcept
Converts std::wstring to std::wstring.
static std::u16string to_u16string(const char *str) noexcept
Converts const char* to std::u16string.
static std::wstring to_wstring(char8 *str) noexcept
Converts char8* to std::wstring.
static std::u8string to_u8string(const std::wstring &str) noexcept
Converts std::wstring to std::u8string.
static std::u32string to_u32string(const char8 *str) noexcept
Converts const char8* to std::u32string.
static std::wstring to_wstring(char32 *str) noexcept
Converts char32* to std::wstring.
static std::wstring to_wstring(const std::string &str) noexcept
Converts std::string to std::wstring.
static std::wstring to_wstring(const char16 *str) noexcept
Converts const char16* to std::wstring.
static xtd::string to_ustring(char16 *str) noexcept
Converts char16* to xtd::string.
static std::string to_string(const std::u8string &str) noexcept
Converts std::u8string to std::string.
#define static_
This keyword is use to represent a static object. A static object can't be instantiated (constructors...
Definition static.h:37
char8_t char8
Represents a 8-bit unicode character.
Definition char8.h:27
wchar_t wchar
Represents a wide character.
Definition wchar.h:24
char16_t char16
Represents a 16-bit unicode character.
Definition char16.h:26
char32_t char32
Represents a 32-bit unicode character.
Definition char32.h:26
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::static_object class.
Contains xtd::string alias.