本文整理汇总了C++中Q3CString::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ Q3CString::contains方法的具体用法?C++ Q3CString::contains怎么用?C++ Q3CString::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q3CString
的用法示例。
在下文中一共展示了Q3CString::contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: special
void Q3Url::encode( QString& url )
{
if ( url.isEmpty() )
return;
Q3CString curl = url.utf8();
int oldlen = curl.length();
const Q3CString special( "+<>#@\"&%$:,;?={}|^~[]\'`\\ \n\t\r" );
QString newUrl;
int newlen = 0;
for ( int i = 0; i < oldlen ;++i ) {
uchar inCh = (uchar)curl[ i ];
if ( inCh >= 128 || special.contains(inCh) ) {
newUrl[ newlen++ ] = QLatin1Char( '%' );
ushort c = inCh / 16;
c += c > 9 ? 'A' - 10 : '0';
newUrl[ newlen++ ] = c;
c = inCh % 16;
c += c > 9 ? 'A' - 10 : '0';
newUrl[ newlen++ ] = c;
} else {
newUrl[ newlen++ ] = inCh;
}
}
url = newUrl;
}
示例2: QVERIFY
void tst_Q3CString::contains()
{
Q3CString a;
a="ABCDEFGHIEfGEFG"; // 15 chars
QVERIFY(a.contains('A'));
QVERIFY(!a.contains('Z'));
QVERIFY(a.contains('E'));
QVERIFY(a.contains('F'));
QVERIFY(a.contains("FG"));
QCOMPARE(a.count('A'),1);
QCOMPARE(a.count('Z'),0);
QCOMPARE(a.count('E'),3);
QCOMPARE(a.count('F'),2);
QCOMPARE(a.count("FG"),2);
// QCOMPARE(a.contains(QRegExp("[FG][HI]")),1);
// QCOMPARE(a.contains(QRegExp("[G][HE]")),2);
}
示例3: write_description_properties
void UmlItem::write_description_properties(FileOut & out) {
if (! description().isEmpty()) {
static int rank = 0;
out.indent();
out << "<ownedComment xmi:type=\"uml:Comment\" xmi:id=\"COMMENT_"
<< ++rank << "\" body=\"";
out.quote((const char*)description());//[jasa] ambiguous call
out << "\"/>\n";
}
Q3CString ste = stereotype();
if (_gen_extension) {
const Q3Dict<Q3CString> up = properties();
Q3DictIterator<Q3CString> it(up);
if (it.current()) {
out.indent();
out << "<xmi:Extension extender=\"Bouml\">\n";
if (! ste.isEmpty()) {
out.indent();
out << "\t<stereotype name=\"";
out.quote((const char*)ste);//[jasa] ambiguous call
out << "\"/>\n";
}
do {
out.indent();
out << "\t<taggedValue tag=\"";
out.quote((const char*)it.currentKey());//[jasa] ambiguous call
out << "\" value=\"";
out.quote((const char*)*(it.current()));//[jasa] ambiguous call
out << "\"/>\n";
++it;
} while (it.current());
out.indent();
out << "</xmi:Extension>\n";
}
else if (! ste.isEmpty()) {
out.indent();
out << "<xmi:Extension extender=\"Bouml\"><stereotype name=\"";
out.quote((const char*)ste);//[jasa] ambiguous call
out << "\"/></xmi:Extension>\n";
}
}
if (ste.contains(':') == 1)
// probably a stereotype part of profile
_stereotypes[ste].append(this);
}