本文整理汇总了C++中StringSeq::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ StringSeq::push_back方法的具体用法?C++ StringSeq::push_back怎么用?C++ StringSeq::push_back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringSeq
的用法示例。
在下文中一共展示了StringSeq::push_back方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getClassList
void ScriptSystem::getClassList(const char* prefix, bool sort, StringSeq& result) const {
ClassInfoDict::const_iterator it = m_classInfoReg.begin();
size_t prefixlen = 0;
if (prefix) {
prefixlen = strlen(prefix);
}
for (; it != m_classInfoReg.end(); ++it) {
ClassInfo* ci = it->second;
if (prefixlen) {
if (strncmp(prefix, ci->m_className.c_str(), prefixlen) != 0) {
continue;
}
result.push_back(ci->m_className.c_str() + prefixlen);
} else {
result.push_back(ci->m_className);
}
}
if (sort) {
std::sort(result.begin(), result.end(), std::less<String>());
}
}
示例2: main
int main(int argc, char* argv[])
{
CoInitializeEx(NULL, 0);
Ice::InitializationData id = InitializationData();
id.properties = Ice::createProperties();
id.properties->load("config.server");
id.logger = new MyLoggerI();
Ice::initialize(argc, argv, id);
SyncService svc;
int status = EXIT_FAILURE;
#ifdef _WIN32
status = svc.main(argc, argv, id);
#else
//
// For UNIX, force --nochdir option, so the service isn't started
// with / as the working directory. That way, if the data
// directory is specified as a relative path, we don't
// misinterpret that path.
//
StringSeq args;
args.push_back(argv[0]);
args.push_back("--nochdir");
for(int i = 1; i < argc; ++i)
{
args.push_back(argv[i]);
}
status = svc.main(args);
#endif
return status;
}
示例3: string
bool
Ice::ObjectAdapterI::filterProperties(StringSeq& unknownProps)
{
static const string suffixes[] =
{
"AdapterId",
"Endpoints",
"Locator",
"PublishedEndpoints",
"RegisterProcess",
"ReplicaGroupId",
"Router",
"ThreadPerConnection",
"ThreadPerConnection.StackSize",
"ThreadPool.Size",
"ThreadPool.SizeMax",
"ThreadPool.SizeWarn",
"ThreadPool.StackSize"
};
//
// Do not create unknown properties list if Ice prefix, ie Ice, Glacier2, etc
//
bool addUnknown = true;
string prefix = _name + ".";
for(const char** i = IceInternal::PropertyNames::clPropNames; *i != 0; ++i)
{
string icePrefix = string(*i) + ".";
if(prefix.find(icePrefix) == 0)
{
addUnknown = false;
break;
}
}
bool noProps = true;
PropertyDict props = _instance->initializationData().properties->getPropertiesForPrefix(prefix);
PropertyDict::const_iterator p;
for(p = props.begin(); p != props.end(); ++p)
{
bool valid = false;
for(unsigned int i = 0; i < sizeof(suffixes)/sizeof(*suffixes); ++i)
{
string prop = prefix + suffixes[i];
if(p->first == prop)
{
noProps = false;
valid = true;
break;
}
}
if(!valid && addUnknown)
{
unknownProps.push_back(p->first);
}
}
return noProps;
}
示例4:
StringSeq golem::data::HandlerTrajectory::getProfiles() const {
StringSeq profiles;
for (auto& k : profileDescMap)
profiles.push_back(k.first);
return profiles;
}
示例5: out
void
IceInternal::ReferenceFactory::checkForUnknownProperties(const string& prefix)
{
static const string suffixes[] =
{
"EndpointSelection",
"ConnectionCached",
"PreferSecure",
"LocatorCacheTimeout",
"InvocationTimeout",
"Locator",
"Router",
"CollocationOptimized",
"Context.*"
};
//
// Do not warn about unknown properties list if Ice prefix, ie Ice, Glacier2, etc
//
for(const char** i = IceInternal::PropertyNames::clPropNames; *i != 0; ++i)
{
if(prefix.find(*i) == 0)
{
return;
}
}
StringSeq unknownProps;
PropertyDict props = _instance->initializationData().properties->getPropertiesForPrefix(prefix + ".");
for(PropertyDict::const_iterator p = props.begin(); p != props.end(); ++p)
{
bool valid = false;
for(unsigned int i = 0; i < sizeof(suffixes)/sizeof(*suffixes); ++i)
{
string prop = prefix + "." + suffixes[i];
if(IceUtilInternal::match(p->first, prop))
{
valid = true;
break;
}
}
if(!valid)
{
unknownProps.push_back(p->first);
}
}
if(unknownProps.size())
{
Warning out(_instance->initializationData().logger);
out << "found unknown properties for proxy '" << prefix << "':";
for(unsigned int i = 0; i < unknownProps.size(); ++i)
{
out << "\n " << unknownProps[i];
}
}
}
示例6: tokenizeSeq
StringSeq StringUtil::tokenizeSeq(const char* text, char split /*= ' ' */) {
StringSeq result;
if (!text || !text[0])
return result;
String str;
const char* token = text;
for (; ;) {
/* skip whitespace */
while (*token && uint_t(*token) <= ' ' || *token == split) {
token++;
}
if (!*token) break;
str.clear();
// handle quoted strings
if (*token == '\"') {
token++;
while (*token && *token != '\"') {
str += *token++;
}
result.push_back(str);
str.clear();
if (!*token) {
break;
} else {
token++;
continue;
}
}
do {
str+=*token; token++;
} while (*token != 0 && *token != split);
result.push_back(str);
}
return result;
}
示例7:
StringSeq
Ice::argsToStringSeq(int argc, char* argv[])
{
StringSeq result;
for(int i = 0; i < argc; i++)
{
result.push_back(argv[i]);
}
return result;
}
示例8: listFileByExts
StringSeq PathUtil::listFileByExts(const String& base, const String& path, const String& exts, uint_t flags) {
StringSeq strvec;
FileInfoSeq fileinfos;
fileinfos = getFileInfos(base, path, exts, flags);
for (size_t i=0; i<fileinfos.size(); i++) {
strvec.push_back(fileinfos[i].fullpath);
}
return strvec;
}
示例9: sync
StringSeq
Ice::PluginManagerI::getPlugins()
{
IceUtil::Mutex::Lock sync(*this);
StringSeq names;
for(PluginInfoList::iterator p = _plugins.begin(); p != _plugins.end(); ++p)
{
names.push_back(p->name);
}
return names;
}
示例10: string
bool
Ice::ObjectAdapterI::filterProperties(StringSeq& unknownProps)
{
static const string suffixes[] =
{
"ACM",
"ACM.Close",
"ACM.Heartbeat",
"ACM.Timeout",
"AdapterId",
"Endpoints",
"Locator",
"Locator.EncodingVersion",
"Locator.EndpointSelection",
"Locator.ConnectionCached",
"Locator.PreferSecure",
"Locator.CollocationOptimized",
"Locator.Router",
"MessageSizeMax",
"PublishedEndpoints",
"ReplicaGroupId",
"Router",
"Router.EncodingVersion",
"Router.EndpointSelection",
"Router.ConnectionCached",
"Router.PreferSecure",
"Router.CollocationOptimized",
"Router.Locator",
"Router.Locator.EndpointSelection",
"Router.Locator.ConnectionCached",
"Router.Locator.PreferSecure",
"Router.Locator.CollocationOptimized",
"Router.Locator.LocatorCacheTimeout",
"Router.Locator.InvocationTimeout",
"Router.LocatorCacheTimeout",
"Router.InvocationTimeout",
"ProxyOptions",
"ThreadPool.Size",
"ThreadPool.SizeMax",
"ThreadPool.SizeWarn",
"ThreadPool.StackSize",
"ThreadPool.Serialize",
"ThreadPool.ThreadPriority"
};
//
// Do not create unknown properties list if Ice prefix, ie Ice, Glacier2, etc
//
bool addUnknown = true;
string prefix = _name + ".";
for(const char** i = IceInternal::PropertyNames::clPropNames; *i != 0; ++i)
{
string icePrefix = string(*i) + ".";
if(prefix.find(icePrefix) == 0)
{
addUnknown = false;
break;
}
}
bool noProps = true;
PropertyDict props = _instance->initializationData().properties->getPropertiesForPrefix(prefix);
for(PropertyDict::const_iterator p = props.begin(); p != props.end(); ++p)
{
bool valid = false;
for(unsigned int i = 0; i < sizeof(suffixes)/sizeof(*suffixes); ++i)
{
string prop = prefix + suffixes[i];
if(p->first == prop)
{
noProps = false;
valid = true;
break;
}
}
if(!valid && addUnknown)
{
unknownProps.push_back(p->first);
}
}
return noProps;
}
示例11: string
int
Activator::activate(const string& name,
const string& exePath,
const string& pwdPath,
#ifndef _WIN32
uid_t uid,
gid_t gid,
#endif
const Ice::StringSeq& options,
const Ice::StringSeq& envs,
const ServerIPtr& server)
{
IceUtil::Monitor< IceUtil::Mutex>::Lock sync(*this);
if(_deactivating)
{
throw string("The node is being shutdown.");
}
string path = exePath;
if(path.empty())
{
throw string("The server executable path is empty.");
}
string pwd = IcePatch2Internal::simplify(pwdPath);
#ifdef _WIN32
if(!IceUtilInternal::isAbsolutePath(path))
{
if(path.find('/') == string::npos)
{
//
// Get the absolute pathname of the executable.
//
wchar_t absbuf[_MAX_PATH];
wchar_t* fPart;
wstring ext = path.size() <= 4 || path[path.size() - 4] != '.' ? L".exe" : L"";
//
// IceGrid doesn't support to use string converters, so don't need to use
// any string converter in wstringToString conversions.
//
if(SearchPathW(NULL, IceUtil::stringToWstring(path).c_str(), ext.c_str(), _MAX_PATH, absbuf, &fPart) == 0)
{
if(_traceLevels->activator > 0)
{
Trace out(_traceLevels->logger, _traceLevels->activatorCat);
out << "couldn't find `" << path << "' executable.";
}
throw string("Couldn't find `" + path + "' executable.");
}
path = IceUtil::wstringToString(absbuf);
}
else if(!pwd.empty())
{
path = pwd + "/" + path;
}
}
//
// Get the absolute pathname of the working directory.
//
// IceGrid doesn't support to use string converters, so
// don't need to use any string converter in stringToWstring
// conversions.
//
if(!pwd.empty())
{
wchar_t absbuf[_MAX_PATH];
if(_wfullpath(absbuf, IceUtil::stringToWstring(pwd).c_str(), _MAX_PATH) == NULL)
{
if(_traceLevels->activator > 0)
{
Trace out(_traceLevels->logger, _traceLevels->activatorCat);
out << "cannot convert `" << pwd << "' into an absolute path";
}
throw string("The server working directory path `" + pwd + "' can't be converted into an absolute path.");
}
pwd = IceUtil::wstringToString(absbuf);
}
#endif
//
// Setup arguments.
//
StringSeq args;
args.push_back(path);
args.insert(args.end(), options.begin(), options.end());
if(_traceLevels->activator > 0)
{
Ice::Trace out(_traceLevels->logger, _traceLevels->activatorCat);
out << "activating server `" << name << "'";
if(_traceLevels->activator > 1)
{
out << "\n";
out << "path = " << path << "\n";
if(pwd.empty())
{
string cwd;
//.........这里部分代码省略.........
示例12: out
//.........这里部分代码省略.........
const MapIndexBasePtr& indexBase = *p;
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
{
示例13: if
int
main(int argc, char* argv[])
#endif
{
Ice::StringSeq originalArgs = Ice::argsToStringSeq(argc, argv);
assert(originalArgs.size() > 0);
const string appName = originalArgs[0];
string dataDir;
StringSeq fileSeq;
int compress = 1;
bool verbose;
bool caseInsensitive;
IceUtilInternal::Options opts;
opts.addOpt("h", "help");
opts.addOpt("v", "version");
opts.addOpt("z", "compress");
opts.addOpt("Z", "no-compress");
opts.addOpt("V", "verbose");
opts.addOpt("i", "case-insensitive");
vector<string> args;
try
{
args = opts.parse(originalArgs);
}
catch(const IceUtilInternal::BadOptException& e)
{
cerr << e.reason << endl;
usage(appName);
return EXIT_FAILURE;
}
if(opts.isSet("help"))
{
usage(appName);
return EXIT_SUCCESS;
}
if(opts.isSet("version"))
{
cout << ICE_STRING_VERSION << endl;
return EXIT_SUCCESS;
}
bool doCompress = opts.isSet("compress");
bool dontCompress = opts.isSet("no-compress");
if(doCompress && dontCompress)
{
cerr << appName << ": only one of -z and -Z are mutually exclusive" << endl;
usage(appName);
return EXIT_FAILURE;
}
if(doCompress)
{
compress = 2;
}
else if(dontCompress)
{
compress = 0;
}
verbose = opts.isSet("verbose");
caseInsensitive = opts.isSet("case-insensitive");
if(args.empty())
{
cerr << appName << ": no data directory specified" << endl;
usage(appName);
return EXIT_FAILURE;
}
dataDir = simplify(args[0]);
for(vector<string>::size_type i = 1; i < args.size(); ++i)
{
fileSeq.push_back(simplify(args[i]));
}
try
{
string absDataDir = dataDir;
string cwd;
if(IceUtilInternal::getcwd(cwd) != 0)
{
throw "cannot get the current directory:\n" + IceUtilInternal::lastErrorToString();
}
if(!IceUtilInternal::isAbsolutePath(absDataDir))
{
absDataDir = simplify(cwd + '/' + absDataDir);
}
for(StringSeq::iterator p = fileSeq.begin(); p != fileSeq.end(); ++p)
{
if(!IceUtilInternal::isAbsolutePath(*p))
{
*p = cwd + '/' + *p;
}
}
//
//.........这里部分代码省略.........