aboutsummaryrefslogtreecommitdiff
path: root/pages/projects/codepoint_iterator.md
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-09-11 19:25:25 +0200
committerAdrian Kummerlaender2014-09-11 19:25:25 +0200
commit508f63886336c68b4a758502b5ccb353df345e3d (patch)
treec5b8ccbc6f95777eb9851885712a168cab20f3ab /pages/projects/codepoint_iterator.md
parent218f393c16e4bff9abdd42958ff6d05e23fa281c (diff)
downloadblog_content-508f63886336c68b4a758502b5ccb353df345e3d.tar
blog_content-508f63886336c68b4a758502b5ccb353df345e3d.tar.gz
blog_content-508f63886336c68b4a758502b5ccb353df345e3d.tar.bz2
blog_content-508f63886336c68b4a758502b5ccb353df345e3d.tar.lz
blog_content-508f63886336c68b4a758502b5ccb353df345e3d.tar.xz
blog_content-508f63886336c68b4a758502b5ccb353df345e3d.tar.zst
blog_content-508f63886336c68b4a758502b5ccb353df345e3d.zip
Expanded the content of some project pages
Diffstat (limited to 'pages/projects/codepoint_iterator.md')
-rw-r--r--pages/projects/codepoint_iterator.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/pages/projects/codepoint_iterator.md b/pages/projects/codepoint_iterator.md
index e202571..6da24ea 100644
--- a/pages/projects/codepoint_iterator.md
+++ b/pages/projects/codepoint_iterator.md
@@ -4,6 +4,8 @@
The source code is available on both my [Github] profile and [cgit].
+For readers versed in German a [blog article] describing the implementation in a more detailed manner is available.
+
## Current features
* Bidirectional iteration through unicode codepoints
@@ -11,5 +13,24 @@ The source code is available on both my [Github] profile and [cgit].
* Dereferencing an instance of the iterator yields the codepoint as `char32_t`
* Unit Tests based on GoogleTest
+## Usage example
+
+While all features of this class are demonstrated by Google-Test based [Unit-Tests] we can see a basic `UTF8::CodepointIterator` usage example in the following code snippet. The [example text] is written in Old Norse runes.
+
+
+~~~
+std::string test(u8"ᛖᚴ ᚷᛖᛏ ᛖᛏᛁ ᚧ ᚷᛚᛖᚱ ᛘᚾ ᚦᛖᛋᛋ ᚨᚧ ᚡᛖ ᚱᚧᚨ ᛋᚨᚱ");
+
+for ( UTF8::CodepointIterator iter(test.cbegin());
+ iter != test.cend();
+ ++iter ) {
+ std::wcout << static_cast<wchar_t>(*iter);
+}
+~~~
+{: .language-cpp}
+
[Github]: https://github.com/KnairdA/CodepointIterator
[cgit]: http://code.kummerlaender.eu/CodepointIterator/
+[Unit-Tests]: https://github.com/KnairdA/CodepointIterator/blob/master/test.cc
+[example text]: http://www.columbia.edu/~fdc/utf8/
+[blog article]: /article/notizen_zu_cpp_und_unicode