本文整理汇总了C++中utils::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ utils::toString方法的具体用法?C++ utils::toString怎么用?C++ utils::toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils
的用法示例。
在下文中一共展示了utils::toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toString
void
NdbapiDriver::initProperties() {
CrundDriver::initProperties();
cout << "setting ndb properties ..." << flush;
ostringstream msg;
mgmdConnect = toString(props[L"ndb.mgmdConnect"]);
if (mgmdConnect.empty()) {
mgmdConnect = string("localhost");
}
catalog = toString(props[L"ndb.catalog"]);
if (catalog.empty()) {
catalog = string("crunddb");
}
schema = toString(props[L"ndb.schema"]);
if (schema.empty()) {
schema = string("def");
}
//if (msg.tellp() == 0) {
if (msg.str().empty()) {
cout << " [ok]" << endl;
} else {
cout << endl << msg.str() << endl;
}
descr = "ndbapi(" + mgmdConnect + ")";
}
示例2: LengthOp
LengthOp(int length) : Op(string(*ON)
+ toString(length)
+ (OB ? "_bulk" : "")),
length(length) {
}
示例3: toBool
void
TwsDriver::initProperties() {
Driver::initProperties();
cout << "setting tws properties ..." << flush;
ostringstream msg;
renewConnection = toBool(props[L"renewConnection"], false);
renewOperations = toBool(props[L"renewOperations"], false);
logSumOfOps = toBool(props[L"logSumOfOps"], true);
string lm = toString(props[L"lockMode"]);
if (lm.empty()) {
lockMode = READ_COMMITTED;
} else if (lm.compare("READ_COMMITTED") == 0) {
lockMode = READ_COMMITTED;
} else if (lm.compare("SHARED") == 0) {
lockMode = SHARED;
} else if (lm.compare("EXCLUSIVE") == 0) {
lockMode = EXCLUSIVE;
} else {
msg << "[ignored] lockMode: '" << lm << "'" << endl;
lockMode = READ_COMMITTED;
}
nOpsStart = toInt(props[L"nOpsStart"], 256, 0);
if (nOpsStart < 1) {
msg << "[ignored] nOpsStart: '"
<< toString(props[L"nOpsStart"]) << "'" << endl;
nOpsStart = 256;
}
nOpsEnd = toInt(props[L"nOpsEnd"], nOpsStart, 0);
if (nOpsEnd < nOpsStart) {
msg << "[ignored] nOpsEnd: '"
<< toString(props[L"nOpsEnd"]) << "'" << endl;
nOpsEnd = nOpsStart;
}
nOpsScale = toInt(props[L"nOpsScale"], 2, 0);
if (nOpsScale < 2) {
msg << "[ignored] nOpsScale: '"
<< toString(props[L"nOpsScale"]) << "'" << endl;
nOpsScale = 2;
}
doInsert = toBool(props[L"doInsert"], true);
doLookup = toBool(props[L"doLookup"], true);
doUpdate = toBool(props[L"doUpdate"], true);
doDelete = toBool(props[L"doDelete"], true);
doBulk = toBool(props[L"doBulk"], true);
doEach = toBool(props[L"doEach"], true);
doIndy = toBool(props[L"doIndy"], true);
doVerify = toBool(props[L"doVerify"], true);
if (!msg.tellp()) {
cout << " [ok: "
<< "nOps=" << nOpsStart << ".." << nOpsEnd << "]" << endl;
} else {
cout << endl << msg.str() << endl;
}
}