//-------------------------------------------------------------- void ofxEditorSettings::setMatchingChars(u32string openChars, u32string closeChars) { if(openChars.length() == 0 || closeChars.length() == 0) { ofLogWarning("ofxEditorSettings") << "empty open or close char string"; return; } openChars = openChars; closeChars = closeChars; }
//-------------------------------------------------------------- void ofxEditorSyntax::setPunctuationChars(const u32string &chars) { if(chars.length() == 0) { ofLogWarning("ofxEditorSyntax") << "empty punctuation string"; return; } punctuationChars = chars; }
//-------------------------------------------------------------- void ofxEditorSyntax::setOperatorChars(const u32string &chars) { if(chars.length() == 0) { ofLogWarning("ofxEditorSyntax") << "empty operator string"; return; } operatorChars = chars; }
shared_ptr<string> EmojiBase32::u32StringToUtf8(const u32string& in) { shared_ptr<string> result = make_shared<string>(); string out(6, '\0'); for (size_t n = 0; n < in.size(); ++n) { size_t offset = 0; U8_APPEND_UNSAFE(&out[0], offset, in[n]); result->append(out, 0, offset); } return result; }
string convertUtf32ToUtf8String(const u32string& utf32string) { string result; utf8::utf32to8(utf32string.begin(), utf32string.begin(), back_inserter(result)); return result; }