예제 #1
0
//--------------------------------------------------------------
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;
}
예제 #2
0
//--------------------------------------------------------------
void ofxEditorSyntax::setPunctuationChars(const u32string &chars) {
	if(chars.length() == 0) {
		ofLogWarning("ofxEditorSyntax") << "empty punctuation string";
		return;
	}
	punctuationChars = chars;
}
예제 #3
0
//--------------------------------------------------------------
void ofxEditorSyntax::setOperatorChars(const u32string &chars) {
	if(chars.length() == 0) {
		ofLogWarning("ofxEditorSyntax") << "empty operator string";
		return;
	}
	operatorChars = chars;
}
예제 #4
0
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;
}
예제 #5
0
string convertUtf32ToUtf8String(const u32string& utf32string)
{
  string result;
  utf8::utf32to8(utf32string.begin(), utf32string.begin(), back_inserter(result));
  return result;
}