From c100d5a9856f01f1942c53272a0847f7cd2d5af4 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 11 Sep 2014 19:25:25 +0200 Subject: Expanded the content of some project pages --- .../00_content/pages/projects/codepoint_iterator.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source/00_content/pages/projects/codepoint_iterator.md') diff --git a/source/00_content/pages/projects/codepoint_iterator.md b/source/00_content/pages/projects/codepoint_iterator.md index e202571..6da24ea 100644 --- a/source/00_content/pages/projects/codepoint_iterator.md +++ b/source/00_content/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(*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 -- cgit v1.2.3