本文整理汇总了C++中lString16::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ lString16::clear方法的具体用法?C++ lString16::clear怎么用?C++ lString16::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lString16
的用法示例。
在下文中一共展示了lString16::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onToken
void onToken(char token) {
// 4,5: font-family:
// 6,7: font-weight:
// 8,9: font-style:
//10,11: src:
// 10 11 12 13
// src : url (
//CRLog::trace("state==%d: %c ", _state, token);
switch (token) {
case ':':
if (_state < 2) {
_state = 0;
} else if (_state == 4 || _state == 6 || _state == 8 || _state == 10) {
_state++;
} else if (_state != 3) {
_state = 2;
}
break;
case ';':
if (_state < 2) {
_state = 0;
} else if (_state != 3) {
_state = 2;
}
break;
case '{':
if (_state == 1) {
_state = 2; // inside @font {
_face.clear();
_italic = false;
_bold = false;
_url.clear();
} else
_state = 3; // inside other {
break;
case '}':
if (_state == 2) {
if (!_url.empty()) {
// CRLog::trace("@font { face: %s; bold: %s; italic: %s; url: %s", _face.c_str(), _bold ? "yes" : "no",
// _italic ? "yes" : "no", LCSTR(_url));
_fontList.add(_url, _face, _bold, _italic);
}
}
_state = 0;
break;
case '(':
if (_state == 12) {
_state = 13;
} else {
if (_state > 3)
_state = 2;
}
break;
}
}
示例2: splitFName
static void splitFName( lString16 pathname, lString16 & path, lString16 & name )
{
//
int spos = -1;
for ( spos=pathname.length()-1; spos>=0; spos-- ) {
lChar16 ch = pathname[spos];
if ( ch=='\\' || ch=='/' ) {
break;
}
}
if ( spos>=0 ) {
path = pathname.substr( 0, spos+1 );
name = pathname.substr( spos+1, pathname.length()-spos-1 );
} else {
path.clear();
name = pathname;
}
}