本文整理汇总了C++中stringlist::const_iterator类的典型用法代码示例。如果您正苦于以下问题:C++ const_iterator类的具体用法?C++ const_iterator怎么用?C++ const_iterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了const_iterator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void TOPPASResources::load(const QString& file_name)
{
Param load_param;
ParamXMLFile paramFile;
paramFile.load(String(file_name), load_param);
for (Param::ParamIterator it = load_param.begin(); it != load_param.end(); ++it)
{
StringList substrings;
it.getName().split(':', substrings);
if (substrings.size() != 2 ||
substrings.back() != "url_list" ||
(it->value).valueType() != DataValue::STRING_LIST)
{
std::cerr << "Invalid file format." << std::endl;
return;
}
QString key = (substrings[0]).toQString();
StringList url_list = (it->value);
QList<TOPPASResource> resource_list;
for (StringList::const_iterator it = url_list.begin(); it != url_list.end(); ++it)
{
resource_list << TOPPASResource(QUrl(it->toQString()));
}
add(key, resource_list);
}
}
示例2: writeSubEngines
void CMakeProvider::writeSubEngines(const BuildSetup &setup, std::ofstream &workspace) const {
for (EngineDescList::const_iterator i = setup.engines.begin(), end = setup.engines.end(); i != end; ++i) {
// We ignore all sub engines here because they are handled in the inner loop
if (!i->enable || isSubEngine(i->name, setup.engines) || i->subEngines.empty()) {
continue;
}
std::string engineName;
std::transform(i->name.begin(), i->name.end(), std::back_inserter(engineName), toupper);
workspace << "set(SUB_ENGINES_" << engineName;
for (StringList::const_iterator j = i->subEngines.begin(), subEnd = i->subEngines.end(); j != subEnd; ++j) {
const EngineDesc &subEngine = findEngineDesc(*j, setup.engines);
if (!subEngine.enable) continue;
std::string subEngineName;
std::transform(j->begin(), j->end(), std::back_inserter(subEngineName), toupper);
workspace << " " << subEngineName;
}
workspace << ")\n";
}
workspace << "\n";
}
示例3: MakeAPIFilter
String FileFilter::MakeAPIFilter() const
{
String filter;
if ( !extensions.IsEmpty() )
{
if ( !description.IsEmpty() )
{
filter += description;
filter += " (";
}
for ( StringList::const_iterator i = extensions.Begin();
i != extensions.End();
++i )
{
if ( i != extensions.Begin() )
filter += ' '; // also legal are ';' and ','
if ( i->StartsWith( '.' ) )
filter += '*';
filter += *i;
}
if ( !description.IsEmpty() )
filter += ')';
}
return filter;
}
示例4: Start
void ExternalProcess::Start( const String& program, const StringList& arguments )
{
Array<const char16_type*> argv;
for ( StringList::const_iterator i = arguments.Begin(); i != arguments.End(); ++i )
argv.Add( i->c_str() );
if ( (*API->ExternalProcess->StartExternalProcess)( handle, program.c_str(), argv.Begin(), argv.Length() ) == api_false )
throw APIFunctionError( "StartExternalProcess" );
}
示例5: SetEnvironment
void ExternalProcess::SetEnvironment( const StringList& environment )
{
Array<const char16_type*> vars;
for ( StringList::const_iterator i = environment.Begin(); i != environment.End(); ++i )
vars.Add( i->c_str() );
if ( (*API->ExternalProcess->SetExternalProcessEnvironment)( handle, vars.Begin(), vars.Length() ) == api_false )
throw APIFunctionError( "SetExternalProcessEnvironment" );
}
示例6: setOptionValue
void SWOptionFilter::setOptionValue(const char *ival) {
for (StringList::const_iterator loop = optValues->begin(); loop != optValues->end(); loop++) {
if (!stricmp(loop->c_str(), ival)) {
optionValue = *loop;
option = (!strnicmp(ival, "On", 2)); // convenience for boolean filters
break;
}
}
}
示例7: ExecuteProgram
int ExternalProcess::ExecuteProgram( const String& program, const StringList& arguments )
{
Array<const char16_type*> argv;
for ( StringList::const_iterator i = arguments.Begin(); i != arguments.End(); ++i )
argv.Add( i->c_str() );
int retVal = (*API->ExternalProcess->ExecuteProgram)( program.c_str(), argv.Begin(), argv.Length() );
if ( retVal < -1 )
ExternalProcessPrivate::Throw( ExternalProcessContext::FailedToStart );
return retVal;
}
示例8: FromString
bool FileDataCacheItem::FromString( const String& s )
{
path.Clear();
lastUsed = 0;
time.year = 0;
StringList tokens;
s.Break( tokens, char16_type( '\n' ) );
for ( StringList::const_iterator i = tokens.Begin(); i != tokens.End(); )
{
if ( *i == "path" )
{
if ( ++i == tokens.End() )
return false;
path = i->Trimmed();
++i;
}
else if ( *i == "lastUsed" )
{
if ( ++i == tokens.End() )
return false;
lastUsed = i->ToUInt();
++i;
}
else if ( *i == "time" )
{
if ( tokens.End() - i < 3 )
return false;
int y, m, d; double f;
JDToComplexTime( y, m, d, f, i[1].ToUInt()+0.5 );
unsigned t = i[2].ToUInt();
time.year = y;
time.month = m;
time.day = d;
time.milliseconds = t - 86399000;
time.hour = TruncI( (t = TruncI( t/1000.0 ))/3600.0 );
time.minute = TruncI( (t -= time.hour*3600)/60.0 );
time.second = t - time.minute*60;
i += 3;
}
else if ( *i == "data" )
{
if ( !GetDataFromTokens( tokens ) )
return false;
++i;
}
else
{
++i;
}
}
return !path.IsEmpty() && lastUsed > 0 && time.year > 0 && ValidateData();
}
示例9: StartProgram
ExternalProcess::pid_type ExternalProcess::StartProgram( const String& program, const StringList& arguments, const String& workingDirectory )
{
Array<const char16_type*> argv;
for ( StringList::const_iterator i = arguments.Begin(); i != arguments.End(); ++i )
argv.Add( i->c_str() );
uint64 pid = 0;
api_bool ok = (*API->ExternalProcess->StartProgram)( program.c_str(), argv.Begin(), argv.Length(), workingDirectory.c_str(), &pid );
if ( ok == api_false || pid == 0 )
ExternalProcessPrivate::Throw( ExternalProcessContext::FailedToStart );
return pid_type( pid );
}
示例10: isNotPrintable
bool LDAPAttribute::isNotPrintable() const {
StringList::const_iterator i;
for(i=m_values.begin(); i!=m_values.end(); i++) {
size_t len = i->size();
for(size_t j=0; j<len; j++) {
if (! isprint( (i->data())[j] ) ) {
return true;
}
}
}
return false;
}
示例11: GetVector
bool FileDataCacheItem::GetVector( DVector& v, StringList::const_iterator& i, const StringList& s )
{
if ( i == s.End() )
return false;
int n = i->ToInt();
if ( n < 0 || s.End() - i <= n )
return false;
++i;
v = DVector( n );
for ( int j = 0; j < n; ++j, ++i )
v[j] = i->ToDouble();
return true;
}
示例12: LoadFiltersFromGlobalString
void LoadFiltersFromGlobalString( const IsoString& globalKey )
{
filters.Clear();
String s = PixInsightSettings::GlobalString( globalKey );
if ( !s.IsEmpty() )
{
for ( size_type p = 0; ; )
{
size_type p1 = s.Find( '(', p );
if ( p1 == String::notFound )
break;
size_type p2 = s.Find( ')', p1 );
if ( p2 == String::notFound )
break;
String extStr = s.Substring( p1, p2-p1 );
if ( !extStr.IsEmpty() )
{
StringList extLst;
extStr.Break( extLst, ' ', true );
if ( !extLst.IsEmpty() )
{
FileFilter filter;
for ( StringList::const_iterator i = extLst.Begin(); i != extLst.End(); ++i )
{
size_type d = i->Find( '.' );
if ( d != String::notFound )
filter.AddExtension( i->Substring( d ) );
}
if ( !filter.Extensions().IsEmpty() )
{
String desc = s.Substring( p, p1-p );
desc.Trim();
filter.SetDescription( desc );
filters.Add( filter );
}
}
}
p = p2 + 1;
}
}
}
示例13:
StringList
Slice::ObjCGenerator::MetaDataVisitor::getMetaData(const ContainedPtr& cont)
{
StringList ret;
StringList localMetaData = cont->getMetaData();
StringList::const_iterator p;
for(p = localMetaData.begin(); p != localMetaData.end(); ++p)
{
if(p->find(_objcPrefix) != string::npos)
{
ret.push_back(*p);
}
}
return ret;
}
示例14: rset
/* {{{ MySQL_ArtResultSet::MySQL_ArtResultSet() -I- */
MySQL_ArtResultSet::MySQL_ArtResultSet(const StringList& fn, rset_t* const rs, boost::shared_ptr< MySQL_DebugLogger > & l)
: num_fields(static_cast<int>(fn.size())), rset(rs), current_record(rset->begin()),
started(false), field_index_to_name_map(new sql::SQLString[num_fields]),
num_rows(rset->size()), row_position(0), is_closed(false), logger(l)
{
CPP_ENTER("MySQL_ArtResultSet::MySQL_ArtResultSet");
CPP_INFO_FMT("metadata.size=%d resultset.size=%d", fn.size(), rset->size());
// field_index_to_name_map = new sql::SQLString[num_fields];
unsigned int idx = 0;
for (StringList::const_iterator it = fn.begin(), e = fn.end(); it != e; ++it, ++idx) {
boost::scoped_array< char > upstring(sql::mysql::util::utf8_strup(it->c_str(), 0));
field_name_to_index_map[sql::SQLString(upstring.get())] = idx;
field_index_to_name_map[idx] = upstring.get();
}
meta.reset(new MySQL_ArtResultSetMetaData(this, logger));
}
示例15:
void
mitk::DICOMGDCMTagScanner
::Scan()
{
// TODO integrate push/pop locale??
m_GDCMScanner.Scan( m_InputFilenames );
m_ScanResult.clear();
for (StringList::const_iterator inputIter = m_InputFilenames.begin();
inputIter != m_InputFilenames.end();
++inputIter)
{
m_ScanResult.push_back( DICOMGDCMImageFrameInfo::New( DICOMImageFrameInfo::New(*inputIter, 0), m_GDCMScanner.GetMapping(inputIter->c_str()) ) );
}
}