本文整理汇总了C++中StringList::merge方法的典型用法代码示例。如果您正苦于以下问题:C++ StringList::merge方法的具体用法?C++ StringList::merge怎么用?C++ StringList::merge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringList
的用法示例。
在下文中一共展示了StringList::merge方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleIq
bool Disco::handleIq( const IQ& iq )
{
switch( iq.subtype() )
{
case IQ::Get:
{
IQ re( IQ::Result, iq.from(), iq.id() );
re.setFrom( iq.to() );
const SoftwareVersion* sv = iq.findExtension<SoftwareVersion>( ExtVersion );
if( sv )
{
re.addExtension( new SoftwareVersion( m_versionName, m_versionVersion, m_versionOs ) );
m_parent->send( re );
return true;
}
const Info *info = iq.findExtension<Info>( ExtDiscoInfo );
if( info )
{
Info *i = new Info( EmptyString, true );
if( !info->node().empty() )
{
i->setNode( info->node() );
IdentityList identities;
StringList features;
DiscoNodeHandlerMap::const_iterator it = m_nodeHandlers.find( info->node() );
if( it == m_nodeHandlers.end() )
{
delete i;
IQ re( IQ::Error, iq.from(), iq.id() );
re.addExtension( new Error( StanzaErrorTypeCancel, StanzaErrorItemNotFound ) );
m_parent->send( re );
return true;
}
else
{
DiscoNodeHandlerList::const_iterator in = (*it).second.begin();
for( ; in != (*it).second.end(); ++in )
{
IdentityList il = (*in)->handleDiscoNodeIdentities( iq.from(), info->node() );
il.sort(); // needed on win32
identities.merge( il );
StringList fl = (*in)->handleDiscoNodeFeatures( iq.from(), info->node() );
fl.sort(); // needed on win32
features.merge( fl );
}
}
i->setIdentities( identities );
i->setFeatures( features );
}
else
{
IdentityList il;
IdentityList::const_iterator it = m_identities.begin();
for( ; it != m_identities.end(); ++it )
{
il.push_back( new Identity( *(*it) ) );
}
i->setIdentities( il );
i->setFeatures( m_features );
if( m_form )
i->setForm( new DataForm( *m_form ) );
}
re.addExtension( i );
m_parent->send( re );
return true;
}
const Items *items = iq.findExtension<Items>( ExtDiscoItems );
if( items )
{
Items *i = new Items( items->node() );
if( !items->node().empty() )
{
DiscoNodeHandlerMap::const_iterator it = m_nodeHandlers.find( items->node() );
if( it == m_nodeHandlers.end() )
{
delete i;
IQ re( IQ::Error, iq.from(), iq.id() );
re.addExtension( new Error( StanzaErrorTypeCancel, StanzaErrorItemNotFound ) );
m_parent->send( re );
return true;
}
else
{
ItemList itemlist;
DiscoNodeHandlerList::const_iterator in = (*it).second.begin();
for( ; in != (*it).second.end(); ++in )
{
ItemList il = (*in)->handleDiscoNodeItems( iq.from(), iq.to(), items->node() );
il.sort(); // needed on win32
itemlist.merge( il );
}
i->setItems( itemlist );
}
}
re.addExtension( i );
//.........这里部分代码省略.........
示例2: fixIdent
bool
Slice::Ruby::CodeVisitor::visitClassDefStart(const ClassDefPtr& p)
{
string scoped = p->scoped();
string name = fixIdent(p->name(), IdentToUpper);
ClassList bases = p->bases();
ClassDefPtr base;
OperationList ops = p->operations();
OperationList::iterator oli;
//
// Define a mix-in module for the class.
//
_out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << "_mixin)";
_out.inc();
_out << nl << "module " << name << "_mixin";
_out.inc();
if(!p->isLocal())
{
if(!bases.empty() && !bases.front()->isInterface())
{
base = bases.front();
_out << nl << "include " << getAbsolute(bases.front(), IdentToUpper) << "_mixin";
}
else
{
_out << nl << "include ::Ice::Object_mixin";
}
//
// ice_ids
//
ClassList allBases = p->allBases();
StringList ids;
#if defined(__IBMCPP__) && defined(NDEBUG)
//
// VisualAge C++ 6.0 does not see that ClassDef is a Contained,
// when inlining is on. The code below issues a warning: better
// than an error!
//
transform(allBases.begin(), allBases.end(), back_inserter(ids),
IceUtil::constMemFun<string,ClassDef>(&Contained::scoped));
#else
transform(allBases.begin(), allBases.end(), back_inserter(ids), IceUtil::constMemFun(&Contained::scoped));
#endif
StringList other;
other.push_back(scoped);
other.push_back("::Ice::Object");
other.sort();
ids.merge(other);
ids.unique();
_out << sp << nl << "def ice_ids(current=nil)";
_out.inc();
_out << nl << "[";
for(StringList::iterator q = ids.begin(); q != ids.end(); ++q)
{
if(q != ids.begin())
{
_out << ", ";
}
_out << "'" << *q << "'";
}
_out << ']';
_out.dec();
_out << nl << "end";
//
// ice_id
//
_out << sp << nl << "def ice_id(current=nil)";
_out.inc();
_out << nl << "'" << scoped << "'";
_out.dec();
_out << nl << "end";
}
if(!ops.empty())
{
//
// Emit a comment for each operation.
//
_out << sp
<< nl << "#"
<< nl << "# Operation signatures."
<< nl << "#";
for(oli = ops.begin(); oli != ops.end(); ++oli)
{
string fixedOpName = fixIdent((*oli)->name(), IdentNormal);
/* If AMI/AMD is ever implemented...
if(!p->isLocal() && (p->hasMetaData("amd") || (*oli)->hasMetaData("amd")))
{
_out << nl << "# def " << fixedOpName << "_async(_cb";
ParamDeclList params = (*oli)->parameters();
for(ParamDeclList::iterator pli = params.begin(); pli != params.end(); ++pli)
{
if(!(*pli)->isOutParam())
{
//.........这里部分代码省略.........
示例3: initModuleEx
int initModuleEx(HWND hParent, HINSTANCE hInstance, const char *lsPath)
{
WNDCLASSEX wc;
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_GLOBALCLASS | CS_DBLCLKS;
wc.lpfnWndProc = Label::windowProcedure;
wc.cbClsExtra = 0;
wc.cbWndExtra = sizeof(Label *);
wc.hInstance = hInstance;
wc.hbrBackground = 0;
wc.hCursor = LoadCursor(0, IDC_ARROW);
wc.hIcon = 0;
wc.lpszMenuName = 0;
wc.lpszClassName = "LabelLS";
wc.hIconSm = 0;
RegisterClassEx(&wc);
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = CS_GLOBALCLASS;
wc.lpfnWndProc = MessageHandlerProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hbrBackground = 0;
wc.hCursor = 0;
wc.hIcon = 0;
wc.lpszMenuName = 0;
wc.lpszClassName = "LabelMessageHandlerLS";
wc.hIconSm = 0;
RegisterClassEx(&wc);
messageHandler = CreateWindowEx(WS_EX_TOOLWINDOW,
"LabelMessageHandlerLS",
0,
WS_POPUP,
0, 0, 0, 0,
0,
0,
hInstance,
0);
if (!messageHandler)
return 1;
SendMessage(GetLitestepWnd(),
LM_REGISTERMESSAGE,
(WPARAM) messageHandler,
(LPARAM) lsMessages);
::hInstance = hInstance;
defaultSettings = new LabelSettings();
systemInfo = new SystemInfo();
StringList labelNames = GetRCNameList("Labels");
labelNames.merge(GetRCNameList("Label"));
// if(labelNames.empty()) labelNames.insert(labelNames.end(), "Label");
for(StringListIterator it = labelNames.begin(); it != labelNames.end(); it++)
{
if(GetRCBoolean(*it, "LSBoxName"))
continue;
Label *label = new Label(*it);
label->load(hInstance);
labelList.insert(labelList.end(), label);
}
AddBangCommand("!LabelCreate", CreateLabelBangCommand);
AddBangCommand("!LabelDebug", DebugBangCommand);
//LsBox Support - blkhawk
AddBangCommand("!LabelLsBoxHook", LsBoxHookBangCommand);
return 0;
}