本文整理汇总了C++中yarp::os::Property::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Property::clear方法的具体用法?C++ Property::clear怎么用?C++ Property::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yarp::os::Property
的用法示例。
在下文中一共展示了Property::clear方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scan_xml
void Prop::scan_xml(const std::string& txt, yarp::os::Property& data) {
data.clear();
string line;
for (int i=0; i<(int)txt.size(); i++) {
char ch = txt[i];
if (ch=='\"') {
line += " ";
continue;
}
if (ch!='\r'&&ch!='\n') {
line += ch;
continue;
}
Bottle b(line.c_str());
string var = "dud";
for (int j=1; j<b.size(); j++) {
if (b.get(j-1).asString()=="id=") {
var = b.get(j).asString();
continue;
}
if (b.get(j-1).asString()=="import=") {
data.put(var.c_str(),b.get(j));
}
}
}
}
示例2: getRgbIntrinsicParam
bool Implement_RgbVisualParams_Sender::getRgbIntrinsicParam(yarp::os::Property &intrinsic)
{
yarp::os::Bottle cmd, response;
cmd.addVocab(VOCAB_RGB_VISUAL_PARAMS);
cmd.addVocab(VOCAB_GET);
cmd.addVocab(VOCAB_INTRINSIC_PARAM);
_port.write(cmd, response);
// Minimal check on response, we suppose the response is always correctly formatted
if((response.get(0).asVocab()) == VOCAB_FAILED)
{
intrinsic.clear();
return false;
}
return Property::copyPortable(response.get(3), intrinsic); // will it really work??
}
示例3: scan_hx
void Prop::scan_hx(const std::string& txt, yarp::os::Property& data) {
data.clear();
string line;
for (int i=0; i<(int)txt.size(); i++) {
char ch = txt[i];
if (ch=='\r'||ch=='\n') {
line = "";
continue;
}
if (ch=='[') {
line += '(';
continue;
}
if (ch==']') {
line += ')';
continue;
}
if (ch==',') {
line += ' ';
continue;
}
if (ch!=';') {
line += ch;
continue;
}
Bottle b(line.c_str());
string var = "dud";
for (int j=1; j<b.size(); j++) {
if (b.get(j-1).asString()=="var") {
var = b.get(j).asString();
continue;
}
if (b.get(j-1).asString()=="=") {
Value v = b.get(j);
ConstString s = v.asString();
if (s=="true") {
data.put(var.c_str(),1);
} else if (s=="false") {
data.put(var.c_str(),0);
} else {
data.put(var.c_str(),v);
}
}
}
}
}