本文整理汇总了C++中lString16::length方法的典型用法代码示例。如果您正苦于以下问题:C++ lString16::length方法的具体用法?C++ lString16::length怎么用?C++ lString16::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lString16
的用法示例。
在下文中一共展示了lString16::length方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processLine
void processLine(lString16 & line) {
if (line.lastChar()=='\r' || line.lastChar()=='\n')
line.erase(line.length()-1, 1);
if (state == 0) {
//
if (line.startsWith(lString16("%"))) {
fprintf(out, "%s\n", LCSTR(line));
return;
}
if (line.startsWith(lString16("\\patterns{"))) {
start();
return;
}
} else {
lString16 word;
for (int i=0; i<=line.length(); i++) {
lChar16 ch = (i<line.length()) ? line[i] : 0;
if (ch == '}')
break;
if (ch==' ' || ch=='\t' || ch=='%' || ch==0) {
if (!word.empty()) {
addPattern(word);
word.clear();
}
if (ch!=' ' && ch!='\t')
break;
} else {
word.append(1, ch);
}
}
}
}
示例2: addPattern
void addPattern(lString16 pattern) {
if (pattern[0] == '.')
pattern[0] = ' ';
if (pattern[pattern.length()-1] == '.')
pattern[pattern.length()-1] = ' ';
fprintf(out, " <pattern>%s</pattern>\n", LCSTR(pattern));
}
示例3: 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;
}
}
示例4: TexPattern
TexPattern( const lString16 &s ) : next( NULL )
{
memset( word, 0, sizeof(word) );
memset( attr, '0', sizeof(attr) );
attr[sizeof(attr)-1] = 0;
int n = 0;
for ( int i=0; i<(int)s.length() && n<MAX_PATTERN_SIZE; i++ ) {
lChar16 ch = s[i];
if ( ch>='0' && ch<='9' ) {
attr[n] = (char)ch;
// if (n>0)
// attr[n-1] = (char)ch;
} else {
word[n++] = ch;
}
if (i==(int)s.length()-1)
attr[n+1] = 0;
}
}
示例5: setManglingKey
bool setManglingKey(lString16 key) {
if (key.startsWith(lString16(L"urn:uuid:")))
key = key.substr(9);
_fontManglingKey.clear();
_fontManglingKey.reserve(16);
lUInt8 b = 0;
int n = 0;
for (int i=0; i<key.length(); i++) {
int d = hexDigit(key[i]);
if (d>=0) {
b = (b << 4) | d;
if (++n > 1) {
_fontManglingKey.add(b);
n = 0;
b = 0;
}
}
}
return _fontManglingKey.length() == 16;
}