include/cinder/Unicode.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include "cinder/Cinder.h"
00004 #include "cinder/Function.h"
00005 
00006 namespace cinder {
00007 
00009 size_t      stringLengthUtf8( const char *str, size_t lengthInBytes = 0 );
00011 uint32_t    nextCharUtf8( const char *str, size_t *inOutByte, size_t lengthInBytes = 0 );
00013 size_t      advanceCharUtf8( const char *str, size_t numChars, size_t lengthInBytes = 0 );
00014 
00015 void        lineBreakUtf8( const char *str, const std::function<bool(const char *, size_t)> &measureFn, std::function<void(const char *,size_t)> lineProcessFn );
00016 
00018 enum UnicodeBreaks { UNICODE_MUST_BREAK, UNICODE_ALLOW_BREAK, UNICODE_NO_BREAK, UNICODE_INSIDE_CHAR };
00019 
00021 void        calcLinebreaksUtf8( const char *str, std::vector<uint8_t> *resultBreaks );
00022 
00024 void        calcLinebreaksUtf8( const char *str, size_t strLength, std::vector<uint8_t> *resultBreaks );
00025 
00027 void        calcLinebreaksUtf16( const uint16_t *str, std::vector<uint8_t> *resultBreaks );
00028 
00030 void        calcLinebreaksUtf16( const uint16_t *str, size_t strLength, std::vector<uint8_t> *resultBreaks );
00031 
00032 }