本文整理汇总了C++中StringCollection::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ StringCollection::push_back方法的具体用法?C++ StringCollection::push_back怎么用?C++ StringCollection::push_back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringCollection
的用法示例。
在下文中一共展示了StringCollection::push_back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onLaunchDebugServer
ErrorCode PlatformSessionImpl::onLaunchDebugServer(Session &session,
std::string const &host,
uint16_t &port,
ProcessId &pid) {
ProcessSpawner ps;
StringCollection args;
ps.setExecutable(Platform::GetSelfExecutablePath());
args.push_back("slave");
if (GetLogLevel() == kLogLevelDebug) {
args.push_back("--debug");
} else if (GetLogLevel() == kLogLevelPacket) {
args.push_back("--debug-remote");
}
ps.setArguments(args);
ps.redirectInputToNull();
ps.redirectOutputToBuffer();
ErrorCode error;
error = ps.run();
if (error != kSuccess)
return error;
error = ps.wait();
if (error != kSuccess)
return error;
if (ps.exitStatus() != 0)
return kErrorInvalidArgument;
std::istringstream ss;
ss.str(ps.output());
ss >> port >> pid;
return kSuccess;
}
示例2: GetProcessArguments
bool ProcFS::GetProcessArguments(pid_t pid, StringCollection &args) {
FILE *fp = ProcFS::OpenFILE(pid, "cmdline");
if (fp == nullptr)
return false;
args.clear();
std::string arg;
for (;;) {
char buf[1024], *end, *bp;
size_t nread = fread(buf, 1, sizeof(buf), fp);
if (nread == 0) {
if (!arg.empty()) {
args.push_back(arg);
}
break;
}
bp = buf, end = buf + nread;
while (bp < end) {
while (*bp != '\0') {
arg += *bp++;
}
bp++;
args.push_back(arg);
arg.clear();
}
}
std::fclose(fp);
return true;
}
示例3: Create
GameAsset* Script::Create(StreamReader& reader, GameAsset* /*existingInstance*/)
{
const int length = reader.ReadInt();
Buffer buffer;
buffer.resize(length);
reader.Read(&buffer[0], length);
const int numberOfFunctions = reader.ReadInt();
FunctionTable functionTable;
functionTable.resize(numberOfFunctions);
for (int i = 0; i < numberOfFunctions; i++)
{
Function& item = functionTable[i];
item.Name = reader.ReadString();
item.Position = reader.ReadInt();
item.ArgumentStackSize = reader.ReadInt();
item.ReturnTypes.resize(reader.ReadInt());
for (std::vector<AnyType>::size_type i = 0; i < item.ReturnTypes.size(); i++)
item.ReturnTypes[i] = static_cast<AnyType>(reader.ReadInt());
item.ParameterTypes.resize(reader.ReadInt());
for (std::vector<AnyType>::size_type i = 0; i < item.ParameterTypes.size(); i++)
item.ParameterTypes[i] = static_cast<AnyType>(reader.ReadInt());
}
const int numberOfStrings = reader.ReadInt();
StringCollection stringTable;
stringTable.reserve(numberOfStrings);
for (int i = 0; i < numberOfStrings; i++)
stringTable.push_back(reader.ReadString());
return new Script(buffer, functionTable, stringTable, MoveTag());
}