本文整理汇总了C++中qstringlist::Iterator::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ Iterator::isEmpty方法的具体用法?C++ Iterator::isEmpty怎么用?C++ Iterator::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qstringlist::Iterator
的用法示例。
在下文中一共展示了Iterator::isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ParseMasks
// -----------------------------------------------------------------------
bool ParseMasks(const char *Masks_, QSet<QString> &Patterns_, TExcludePatterns &ExcludePatterns_)
{
QStringList MasksList = QString::fromLocal8Bit(Masks_).split(';', QString::SkipEmptyParts);
for(QStringList::Iterator it = MasksList.begin(); it != MasksList.end(); ++it) {
*it = it->trimmed();
if(it->isEmpty()) return false;
}
//
for(QStringList::Iterator it = MasksList.begin(); it != MasksList.end(); ++it) {
if(Patterns_.contains(*it)) continue;
//
ExcludePatterns_.push_back(QRegExp(*it,
#ifdef Q_OS_WIN
Qt::CaseInsensitive, QRegExp::Wildcard));
#else
Qt::CaseSensitive, QRegExp::WildcardUnix));
#endif
Patterns_.insert(*it);
}
return true;
}
示例2: open
void ReduxWidget::open() {
QStringList files = QFileDialog::getOpenFileNames( this, tr( "Open File" ), "", tr( "Log Files (*_lg*)" ) );
int sz = PATH_MAX + 1; // N.B. It is possible to construct a path longer than PATH_MAX on most systems,
// so this is really not fool-proof...
char* buf = new char[sz];
QStringList::Iterator it = files.begin();
while( it != files.end() ) {
memset( buf, 0, sz * sizeof( char ) );
if( ( ! it->isEmpty() ) && realpath( it->toStdString().c_str(), buf ) ) {
dumpMsg( QString( "Opening LogFile : " ) + *it );
/*LogFile* tmpLog = new LogFile ( buf );
bool skip = false;
for ( unsigned int i=0; i<myLogs.size(); ++i)
if ( !(*(myLogs[i]) != *tmpLog) )
skip = true;
cout << *tmpLog << endl;
if ( ! skip ) myLogs.push_back( tmpLog );
else delete tmpLog;
//myLog.load();
*/
}
++it;
}
delete[] buf;
//emit setsChanged();
//logTree->reset();
//emit jobsChanged();
//jobTree->reset();
//for (int i=0; i<myJobs.size(); ++i) cout << *myJobs[i];
//cout << myNet;
//cout << dumpXML(true) << endl;
}
示例3: readEntryRaw
ConversionStatus GettextImportPlugin::readEntryRaw(QTextStream& stream)
{
//kDebug() << " START";
enum {Begin,Comment,Msgctxt,Msgid,Msgstr} part=Begin;
_trailingNewLines=0;
bool error=false;
bool recoverableError=false;
bool seenMsgctxt=false;
_msgstr.clear();
_msgstr.append(QString());
_msgid.clear();
_msgid.append(QString());
_msgctxt.clear();
_comment.clear();
_gettextPluralForm=false;
_obsolete=false;
QStringList::Iterator msgstrIt=_msgstr.begin();
QString line;
while( !stream.atEnd() )
{
_errorLine++;
//line=stream.readLine();
if (!_bufferedLine.isEmpty())
{
line=_bufferedLine;
_bufferedLine.clear();
}
else
line=stream.readLine();
kDebug() << "Parsing line: " << line;
static const QString lesslessless="<<<<<<<";
static const QString isisis="=======";
static const QString moremoremore=">>>>>>>";
if (KDE_ISUNLIKELY( line.startsWith( lesslessless ) || line.startsWith( isisis ) || line.startsWith( moremoremore ) ))
{
// We have found a CVS/SVN conflict marker. Abort.
// (It cannot be any useful data of the PO file, as otherwise the line would start with at least a quote)
kError() << "CVS/SVN conflict marker found! Aborting!" << endl << line << endl;
return PARSE_ERROR;
}
// remove whitespaces from beginning and end of line
line = line.trimmed();
// remember wrapping state to save file nicely
int len=line.length();
if (len)
{
_trailingNewLines=0;
if (_maxLineLength<len && line.at(0)!='#')
_maxLineLength=len;
}
else
++_trailingNewLines;
if(part==Begin)
{
// ignore trailing newlines
if(!len)
continue;
if(line.startsWith(_obsoleteStart))
{
_obsolete=true;
part=Comment;
_comment=line;
}
else if(line.startsWith('#'))
{
part=Comment;
_comment=line;
}
else if( line.startsWith(_msgctxtStart) && line.contains( _rxMsgCtxt ) )
{
part=Msgctxt;
// remove quotes at beginning and the end of the lines
line.remove(QRegExp("^msgctxt\\s*\""));
line.remove(_rxMsgLineRemEndQuote);
_msgctxt=line;
seenMsgctxt=true;
}
else if( line.contains( _rxMsgId ) )
{
part=Msgid;
// remove quotes at beginning and the end of the lines
line.remove(_rxMsgIdRemQuotes);
line.remove(_rxMsgLineRemEndQuote);
(*(_msgid).begin())=line;
}
// one of the quotation marks is missing
//.........这里部分代码省略.........