本文整理汇总了C++中StringSeq::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ StringSeq::erase方法的具体用法?C++ StringSeq::erase怎么用?C++ StringSeq::erase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringSeq
的用法示例。
在下文中一共展示了StringSeq::erase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: e
void
Ice::PluginManagerI::loadPlugin(const string& name, const string& pluginSpec, StringSeq& cmdArgs)
{
assert(_communicator);
string entryPoint;
StringSeq args;
if(!pluginSpec.empty())
{
//
// Split the entire property value into arguments. An entry point containing spaces
// must be enclosed in quotes.
//
try
{
args = IceUtilInternal::Options::split(pluginSpec);
}
catch(const IceUtilInternal::BadOptException& ex)
{
PluginInitializationException e(__FILE__, __LINE__);
e.reason = "invalid arguments for plug-in `" + name + "':\n" + ex.reason;
throw e;
}
assert(!args.empty());
//
// Shift the arguments.
//
entryPoint = args[0];
args.erase(args.begin());
//
// Convert command-line options into properties. First we
// convert the options from the plug-in configuration, then
// we convert the options from the application command-line.
//
PropertiesPtr properties = _communicator->getProperties();
args = properties->parseCommandLineOptions(name, args);
cmdArgs = properties->parseCommandLineOptions(name, cmdArgs);
}
PluginFactory factory = 0;
DynamicLibraryPtr library;
//
// Always check the static plugin factory table first, it takes
// precedence over the the entryPoint specified in the plugin
// property value.
//
if(factories)
{
map<string, PluginFactory>::const_iterator p = factories->find(name);
if(p != factories->end())
{
factory = p->second;
}
}
//
// If we didn't find the factory, get the factory using the entry
// point symbol.
//
if(!factory)
{
assert(!entryPoint.empty());
library = new DynamicLibrary();
DynamicLibrary::symbol_type sym = library->loadEntryPoint(entryPoint);
if(sym == 0)
{
ostringstream out;
string msg = library->getErrorMessage();
out << "unable to load entry point `" << entryPoint << "'";
if(!msg.empty())
{
out << ": " + msg;
}
PluginInitializationException ex(__FILE__, __LINE__);
ex.reason = out.str();
throw ex;
}
#ifdef __IBMCPP__
// xlC warns when casting a void* to function pointer
# pragma report(disable, "1540-0216")
#endif
factory = reinterpret_cast<PluginFactory>(sym);
}
//
// Invoke the factory function. No exceptions can be raised
// by the factory function because it's declared extern "C".
//
PluginPtr plugin(factory(_communicator, name, args));
if(!plugin)
{
PluginInitializationException e(__FILE__, __LINE__);
ostringstream out;
out << "failure in entry point `" << entryPoint << "'";
//.........这里部分代码省略.........
示例2: out
//.........这里部分代码省略.........
assert(indexBase->_impl == 0);
assert(indexBase->_communicator == 0);
indexBase->_communicator = connection->communicator();
auto_ptr<MapIndexI> indexI;
try
{
indexI.reset(new MapIndexI(connection, *this, txn, createDb, indexBase));
}
catch(const DbDeadlockException&)
{
throw;
}
catch(const DbException& dx)
{
string message = "Error while opening index \"" + _dbName +
"." + indexBase->name() + "\": " + dx.what();
throw DatabaseException(__FILE__, __LINE__, message);
}
#ifndef NDEBUG
bool inserted =
#endif
_indices.insert(IndexMap::value_type(indexBase->name(), indexI.get())).second;
assert(inserted);
indexBase->_impl = indexI.release();
if(createDb)
{
newIndices.push_back(indexBase->name());
oldIndices.erase(std::remove(oldIndices.begin(), oldIndices.end(), indexBase->name()), oldIndices.end());
}
}
if(ci == catalog.end())
{
CatalogData catalogData;
catalogData.evictor = false;
catalogData.key = key;
catalogData.value = value;
catalog.put(Catalog::value_type(_dbName, catalogData));
}
if(createDb)
{
//
// Remove old indices and write the new ones
//
bool indexRemoved = false;
for(StringSeq::const_iterator q = oldIndices.begin(); q != oldIndices.end(); ++q)
{
const string& index = *q;
if(_trace >= 1)
{
Trace out(_communicator->getLogger(), "Freeze.Map");
out << "removing old index \"" << index << "\" on Db \"" << _dbName << "\"";
}
try
{
connection->removeMapIndex(_dbName, *q);