summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/README.md b/README.md
index 80e544f..538a38d 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,24 @@ zg is a modular library. This approach minimizes binary file size and memory
31requirements by only including the Unicode data required for the specified module. 31requirements by only including the Unicode data required for the specified module.
32The following sections describe the various modules and their specific use case. 32The following sections describe the various modules and their specific use case.
33 33
34### Init and Setup
35
36The code examples will show the use of `Module.init(allocator)` to create the
37various modules. All of the allocating modules have a `setup` variant, which
38takes a pointer and allocates in-place.
39
40Example use:
41
42```zig
43test "Setup form" {
44 var graphemes = try allocator.create(Graphemes);
45 defer allocator.destroy(graphemes);
46 try graphemes.setup(allocator);
47 defer graphemes.deinit(allocator);
48}
49```
50
51
34## Code Points 52## Code Points
35 53
36In the `code_point` module, you'll find a data structure representing a single code 54In the `code_point` module, you'll find a data structure representing a single code
@@ -386,6 +404,8 @@ test "Initialize With a Normalize" {
386 defer case_fold.deinit(allocator); 404 defer case_fold.deinit(allocator);
387} 405}
388``` 406```
407This has a `setupWithNormalize` variant as well, but note that this also takes
408a `Normalize` struct, and not a pointer to it.
389 409
390 410
391## Display Width of Characters and Strings 411## Display Width of Characters and Strings