本文整理汇总了C++中ListOfStrings类的典型用法代码示例。如果您正苦于以下问题:C++ ListOfStrings类的具体用法?C++ ListOfStrings怎么用?C++ ListOfStrings使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ListOfStrings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTagParameterList
void ARClef::setTagParameterList(TagParameterList& tpl)
{
if (ltpls.GetCount() == 0)
{
// create a list of string ...
ListOfStrings lstrs; // (1); std::vector test impl
lstrs.AddTail( (
"S,type,treble,r")); // old:;F,size,1.0,o"
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList * rtpl = NULL;
int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
if (ret>=0 && rtpl)
{
// we found a match!
if (ret == 0)
{
TagParameterString * tps = TagParameterString::cast(rtpl->RemoveHead());
assert(tps);
setName(tps->getValue());
delete tps;
}
delete rtpl;
}
else
{
// failure
}
tpl.RemoveAll();
}
示例2: setTagParameterList
void ARNewSystem::setTagParameterList(TagParameterList & tpl)
{
if (ltpls.GetCount() == 0)
{
// create a list of string ...
ListOfStrings lstrs; // (1); std::vector test impl
lstrs.AddTail( ( "U,dy,0,o"));
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList * rtpl = NULL;
int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
if (ret>=0 && rtpl)
{
// we found a match!
if (ret == 0)
mDy = TagParameterFloat::cast(rtpl->RemoveHead());
delete rtpl;
}
else
{
// failure
}
tpl.RemoveAll();
}
示例3: setTagParameterList
void ARStaccato::setTagParameterList(TagParameterList& tpl)
{
if (ltpls.GetCount() == 0)
{
// create a list of string ...
ListOfStrings lstrs; // (1); std::vector test impl
lstrs.AddTail(("S,type,,o"));
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList *rtpl = NULL;
int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
if (ret>=0 && rtpl)
{
// we found a match!
if (ret == 0)
{
TagParameterString * str = TagParameterString::cast(rtpl->RemoveHead());
assert(str);
if (str->TagIsSet())
{
if (str->getValue() == std::string("heavy"))
type = HEAVY;
else type = REGULAR;
}
delete str;
}
delete rtpl;
}
tpl.RemoveAll();
}
示例4: setTagParameterList
void ARRestFormat::setTagParameterList(TagParameterList &tpl)
{
if (ltpls.empty())
{
// create a list of string ...
ListOfStrings lstrs; // (1); std::vector test impl
lstrs.AddTail((""));
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList * rtpl = NULL;
int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
if (ret >= 0 && rtpl)
{
delete rtpl;
}
else
{
// failure
}
tpl.RemoveAll();
}
示例5: setTagParameterList
void ARTStem::setTagParameterList(TagParameterList & tpl)
{
if (ltpls.GetCount() == 0)
{
// create a list of string ...
ListOfStrings lstrs; // (1); std::vector test impl
lstrs.AddTail(( "U,length,7.0,o"));
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList * rtpl = NULL;
const int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
if (ret>=0 && rtpl)
{
// we found a match!
if (ret == 0)
{
// then, we now the match for
// the first ParameterList
// w, h, ml, mt, mr, mb
//GuidoPos pos = rtpl->GetHeadPosition();
mTpfLength = TagParameterFloat::cast( rtpl->RemoveHead());
}
delete rtpl;
}
else
{
// failure...
}
tpl.RemoveAll();
}
示例6: setTagParameterList
void ARMark::setTagParameterList(TagParameterList & tpl)
{
if (ltpls.GetCount() == 0)
{
// create a list of string ...
ListOfStrings lstrs; // (1); std::vector test impl
lstrs.AddTail(
(
"S,text,,r"));
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList *rtpl = NULL;
int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
if (ret>=0 && rtpl)
{
// we found a match!
if (ret == 0)
{
text = TagParameterString::cast(rtpl->RemoveHead());
assert(text);
}
delete rtpl;
}
else
{
// failure
}
tpl.RemoveAll();
}
示例7: setTagParameterList
void ARShareStem::setTagParameterList(TagParameterList & tpl)
{
if (ltpls.GetCount() == 0)
{
// create a list of string ...
ListOfStrings lstrs; // (1); std::vector test impl
lstrs.AddTail(
(
""));
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList *rtpl = NULL;
int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
if (ret>=0 && rtpl)
{
// we found a match!
if (ret == 0)
{
// then, we now the match for
// the first ParameterList
// GuidoPos pos = rtpl->GetHeadPosition();
}
delete rtpl;
}
tpl.RemoveAll();
}
示例8: setTagParameterList
void ARGrace::setTagParameterList(TagParameterList& tpl)
{
if (ltpls.GetCount() == 0)
{
// create a list of string ...
ListOfStrings lstrs; // (1); std::vector test impl
lstrs.AddTail(( "I,i,,o"));
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList * rtpl = 0;
int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
if (ret>=0 && rtpl)
{
// we found a match!
if (ret == 0)
{
num = TagParameterInt::cast(rtpl->RemoveHead());
assert(num);
}
delete rtpl;
}
else
{
// failure
}
tpl.RemoveAll();
}
示例9: setTagParameterList
void ARTremolo::setTagParameterList(TagParameterList& tpl)
{
if (ltpls.GetCount() == 0)
{
// create a list of string ...
ListOfStrings lstrs; // (1); std::vector test impl
lstrs.AddTail((
"I,dur,32,o"
// "S,text,,r;U,dy,-1,o"
));
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList * rtpl = NULL;
int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
if (ret>=0 && rtpl)
{
// we found a match!
if (ret == 0)
{
}
delete rtpl;
}
else
{
// failure
}
tpl.RemoveAll();
}
示例10: GetListOfJobs
void ServerScheduler::GetListOfJobs(ListOfStrings& jobs)
{
boost::mutex::scoped_lock lock(mutex_);
jobs.clear();
for (Jobs::const_iterator
it = jobs_.begin(); it != jobs_.end(); ++it)
{
jobs.push_back(it->first);
}
}
示例11: setTagParameterList
void ARMarcato::setTagParameterList(TagParameterList& tpl)
{
if (ltpls.GetCount() == 0)
{
// create a list of string ...
ListOfStrings lstrs; // (1); std::vector test impl
lstrs.AddTail("S,position,,o");
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList * rtpl = NULL;
int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
if (ret>=0 && rtpl)
{
// we found a match!
if (ret == 0)
{
TagParameterString * str = TagParameterString::cast(rtpl->RemoveHead());
assert(str);
std::string below ("below");
std::string above ("above");
if (str->TagIsSet() && (below == str->getValue()))
{
position = BELOW;
}
else if (str->TagIsSet() && (above == str->getValue()))
{
position = ABOVE;
}
delete str;
// Get The TagParameters ...
// text =
// TagParameterString::cast(rtpl->RemoveHead());
//assert(text);
}
delete rtpl;
}
else
{
// failure
}
tpl.RemoveAll();
}
示例12:
const char *PropertySet::getPropertyName(int which) {
ListOfStrings *propNames = (ListOfStrings *) propertyNameList;
int i = 0;
for (ListOfStrings::iterator itr = propNames->begin(); itr != propNames->end(); itr++, i++) {
if (i == which) {
std::string s = *itr;
char *pc = new char[strlen(s.c_str())+1];
strcpy(pc, s.c_str());
return pc;
}
}
return(NULL);
}
示例13: Apply
bool StorePeerCommand::Apply(ListOfStrings& outputs,
const ListOfStrings& inputs)
{
// Configure the HTTP client
HttpClient client;
client.SetProxy(Configuration::GetGlobalStringParameter("HttpProxy", ""));
if (peer_.GetUsername().size() != 0 &&
peer_.GetPassword().size() != 0)
{
client.SetCredentials(peer_.GetUsername().c_str(),
peer_.GetPassword().c_str());
}
client.SetUrl(peer_.GetUrl() + "instances");
client.SetMethod(HttpMethod_Post);
for (ListOfStrings::const_iterator
it = inputs.begin(); it != inputs.end(); ++it)
{
LOG(INFO) << "Sending resource " << *it << " to peer \""
<< peer_.GetUrl() << "\"";
try
{
context_.ReadFile(client.AccessPostData(), *it, FileContentType_Dicom);
std::string answer;
if (!client.Apply(answer))
{
LOG(ERROR) << "Unable to send resource " << *it << " to peer \"" << peer_.GetUrl() << "\"";
throw OrthancException(ErrorCode_NetworkProtocol);
}
// Only chain with other commands if this command succeeds
outputs.push_back(*it);
}
catch (OrthancException& e)
{
LOG(ERROR) << "Unable to forward to an Orthanc peer in a Lua script (instance "
<< *it << ", peer " << peer_.GetUrl() << "): " << e.What();
if (!ignoreExceptions_)
{
throw;
}
}
}
return true;
}
示例14: setTagParameterList
void ARFermata::setTagParameterList(TagParameterList & tpl)
{
if (ltpls.GetCount() == 0)
{
ListOfStrings lstrs;
lstrs.AddTail("S,type,short,o;S,position,above,o");
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList * rtpl = NULL;
int ret = MatchListOfTPLsWithTPL(ltpls, tpl, &rtpl);
if (ret>=0 && rtpl)
{
// we found a match!
if (ret == 0)
{
TagParameterString * str = TagParameterString::cast(rtpl->RemoveHead());
assert(str);
std::string shortstr ("short");
std::string longstr ("long");
std::string below ("below");
if (str->TagIsSet())
{
if (shortstr == str->getValue())
type = SHORT;
else if (longstr == str->getValue())
type = LONG;
else type = REGULAR;
}
delete str;
str = TagParameterString::cast(rtpl->RemoveHead());
assert(str);
if (str->TagIsSet() && (below == str->getValue()))
{
position = BELOW;
}
else position = ABOVE;
delete str;
}
delete rtpl;
}
tpl.RemoveAll();
}
示例15: setTagParameterList
void ARStaff::setTagParameterList(TagParameterList& tpl)
{
if (ltpls.GetCount() == 0)
{
// create a list of string ...
ListOfStrings lstrs; // (1); std::vector test impl
lstrs.AddTail( ("I,id,,r;U,dy,,o"));
lstrs.AddTail( ("S,id,,r;U,dy,,o"));
CreateListOfTPLs(ltpls,lstrs);
}
TagParameterList * rtpl = NULL;
int ret = MatchListOfTPLsWithTPL(ltpls,tpl,&rtpl);
if (ret>=0 && rtpl)
{
// we found a match!
if (ret == 0)
{
idi = TagParameterInt::cast(rtpl->RemoveHead());
assert(idi);
if (idi->getValue() < 1)
{
GuidoWarn("Staff-Parameter-Value smaller than 1");
idi->setValue(1);
}
mDy = TagParameterFloat::cast(rtpl->RemoveHead());
assert(mDy);
}
else if (ret==1)
{
// we have a match with the second parameter ...
ids = TagParameterString::cast(rtpl->RemoveHead());
assert(ids);
mDy = TagParameterFloat::cast(rtpl->RemoveHead());
assert(mDy);
}
delete rtpl;
}
else
{
// failure ...
}
if (idi && idi->getValue() < 0)
idi->setValue(0);
tpl.RemoveAll();
}