File tree Expand file tree Collapse file tree 2 files changed +20
-16
lines changed
Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change 88
99你可以通过以下 API 转换字符串:
1010
11- * ` ext::to_string `
12- * ` ext::to_u8string `
13- * ` ext::to_u16string `
14- * ` ext::to_u32string `
15- * ` ext::to_wstring `
11+ * ` ext::convert<std::string> `
12+ * ` ext::convert<std::u8string> `
13+ * ` ext::convert<std::u16string> `
14+ * ` ext::convert<std::u32string> `
15+ * ` ext::convert<std::wstring> `
1616
1717``` c++
1818#include < iostream>
19- #include < ext/string.hpp>
19+ #include < ext/convert.hpp>
20+ #include < ext/convert_windows_.hpp>
2021
2122using std::string_view_literals::operator " " sv;
2223
2324int main () {
24- std::wcout << ext::to_wstring ("Hello world!"sv) << std::endl;
25+ std::wcout << ext::convert < std::wstring > ("Hello world!"sv) << std::endl;
2526 return 0;
2627}
2728```
@@ -30,7 +31,8 @@ int main() {
3031
3132``` c++
3233#define PAINFUL_CPP_STRING_CONVERSION_NAMESPACE foo
33- #include <ext/string.hpp>
34+ #include <ext/convert.hpp>
35+ #include <ext/convert_windows_ .hpp>
3436```
3537
3638## 互转表格
Original file line number Diff line number Diff line change @@ -8,20 +8,21 @@ Why the conversion between C++ string/wstring/u8string/u16string/u32string so pa
88
99You can convert strings through the following API:
1010
11- * ` ext::to_string `
12- * ` ext::to_u8string `
13- * ` ext::to_u16string `
14- * ` ext::to_u32string `
15- * ` ext::to_wstring `
11+ * ` ext::convert<std::string> `
12+ * ` ext::convert<std::u8string> `
13+ * ` ext::convert<std::u16string> `
14+ * ` ext::convert<std::u32string> `
15+ * ` ext::convert<std::wstring> `
1616
1717``` c++
1818#include < iostream>
19- #include < ext/string.hpp>
19+ #include < ext/convert.hpp>
20+ #include < ext/convert_windows_.hpp>
2021
2122using std::string_view_literals::operator " " sv;
2223
2324int main () {
24- std::wcout << ext::to_wstring ("Hello world!"sv) << std::endl;
25+ std::wcout << ext::convert < std::wstring > ("Hello world!"sv) << std::endl;
2526 return 0;
2627}
2728```
@@ -30,7 +31,8 @@ You can customize namespace:
3031
3132``` c++
3233#define PAINFUL_CPP_STRING_CONVERSION_NAMESPACE foo
33- #include <ext/string.hpp>
34+ #include <ext/convert.hpp>
35+ #include <ext/convert_windows_ .hpp>
3436```
3537
3638## Conversion matrix
You can’t perform that action at this time.
0 commit comments