Skip to content

Commit 6b33e8b

Browse files
authored
Merge pull request #7 from b1tflyyyy/added_readme
update readme
2 parents 4fa3176 + a50fb30 commit 6b33e8b

File tree

1 file changed

+34
-22
lines changed

1 file changed

+34
-22
lines changed

README.md

+34-22
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,50 @@
1-
## UTF-8 String For C++ (utf8::ustring)
1+
## ⚙️ UTF-8 String For C++ (utf8::ustring)
22

3-
## Brief Description:
4-
This is an implementation of the UTF-8 encoding standard for C++, the implementation is based on the std::basic_string\<char\> class, this gives us the advantage of std::basic_string\<char\> class functions, as well as compatibility with some functions from the standard library.
3+
## 📜 Brief Description:
4+
This is an implementation of the `UTF-8` encoding standard for `C++`, the implementation is based on the `std::basic_string<char>` class, this gives us the advantage of `std::basic_string<char>` class functions, as well as compatibility with some functions from the standard library.
55

6-
## Code Style:
7-
- C++ AStyle code style was used for this project.
6+
## 📝 Code Style:
7+
- `C++ AStyle` code style was used for this project.
88

9-
## Technical Dependencies:
10-
- C++ 20
11-
- CMake 3.14
9+
## 🛠 Technical Dependencies:
10+
- `C++ 20`
11+
- `CMake 3.14`
1212

13-
## Support Status On Systems:
14-
- [X] Linux
15-
- [ ] Windows (not yet verified)
13+
## 🔗 Support Status On Systems:
14+
- [X] Linux (verified on clang)
15+
- [X] Windows (verified on gcc && clang)
1616

17-
## Library Features:
17+
## 💫 Library Features:
1818
- Support for creating an object from: `std::string, std::string_view, const char*`
1919
- Comparing an `utf8::ustring` with `utf8::ustring` (comparison with `const char*`, `std::string`, `std::string_view` will be added in the future)
2020
- Copy/Move (<- assignment also) constructor implemented
2121
- O(1) Random Access
22-
- Simple replacement of any character, e.g. a smaller character (1 byte) with a larger character (2-3-4 bytes).
22+
- Simple replacement of any character, e.g. a smaller character `(1 byte)` with a larger character `(2-3-4 bytes)`.
2323

24-
## Performance Test:
24+
## ⚡️ Performance Test:
2525
| String-Version | Test-Name | iteration count | time (for all iterations) |
2626
|:--------------:|:-----------------------:|:---------------:|:-------------------------:|
2727
| std::string | replace_char | 500'000 | ~0.57s |
2828
| utf8::ustring | replace_char | 500'000 | ~0.60s |
2929

30-
## Coming Soon:
31-
- A more detailed test and description of the string speed.
32-
- Test in Windows.
33-
- Introduction of new functions.
34-
- Code samples.
30+
## ❔ Replace Char O(1) ?
31+
Yes and no, in the case where we replace a character with another `with the same size`, we have `O(1)`, in the other case we have `O(~N)`, where N is the length of the string.
32+
But in any case we have `O(1) Random Access`.
3533

36-
<div style="text-align: center;">
37-
© 2024 Andrii (AKA b1tflyyyy). All rights reserved.
38-
</div>
34+
## 📚 Code Samples:
35+
```cpp
36+
std::string str{ "hello world!" };
37+
utf8::ustring ustr{ str };
38+
39+
ustr.replace_char("п", 0); // "пello world!"
40+
41+
ustr == "hi !"; // false
42+
ustr == str; // false
43+
```
44+
45+
## ⭐️ Coming Soon:
46+
- Write/read to file.
47+
- Add new features.
48+
- Docs.
49+
50+
### © 2024 Andrii (AKA b1tflyyyy). All rights reserved.

0 commit comments

Comments
 (0)