Skip to content

Commit 062fb95

Browse files
committed
update readme
1 parent 830f236 commit 062fb95

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

README.ZH.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@
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

2122
using std::string_view_literals::operator""sv;
2223

2324
int 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
## 互转表格

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ Why the conversion between C++ string/wstring/u8string/u16string/u32string so pa
88

99
You 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

2122
using std::string_view_literals::operator""sv;
2223

2324
int 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

0 commit comments

Comments
 (0)