本文整理汇总了C++中wxXmlNode类的典型用法代码示例。如果您正苦于以下问题:C++ wxXmlNode类的具体用法?C++ wxXmlNode怎么用?C++ wxXmlNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxXmlNode类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetStringAttribute
wxString
GetStringAttribute(const wxXmlNode& node, const wxString& name, const wxString& def)
{
wxString value;
if (!node.GetPropVal(name, &value))
{
if (def == wxEmptyString)
{
THROW("Couldn't find attribute \"%s\" in element <%s>.", name.c_str(), node.GetName().c_str());
}
value = def;
}
return value;
}
开发者ID:nocturnal,项目名称:FragmentShader,代码行数:14,代码来源:xml.cpp
示例2: DeleteChild
void
DeleteChild(wxXmlNode& node, wxXmlNodeType type)
{
wxXmlNode *child = node.GetChildren();
while (child != NULL)
{
if (child->GetType() == type)
{
node.RemoveChild(child);
DESTROY(child);
return;
}
child = child->GetNext();
}
}
开发者ID:nocturnal,项目名称:FragmentShader,代码行数:15,代码来源:xml.cpp
示例3:
void
MethodLua::Deserialize(const wxXmlNode& root)
{
m_source = root.GetNodeContent();
LuaUtil::LoadBuffer(g_L, m_source.c_str(), m_source.Len(), "method");
m_lua_ref = luaL_ref(g_L, LUA_REGISTRYINDEX);
Method::Deserialize(root);
}
开发者ID:nocturnal,项目名称:FragmentShader,代码行数:8,代码来源:method.cpp
示例4: Compile
void
MethodVarParse::Deserialize(const wxXmlNode& root)
{
m_pattern = root.GetNodeContent();
m_source = Compile(m_pattern);
wxXmlNode *child = root.GetChildren();
while (child != NULL)
{
if (child->GetType() == wxXML_TEXT_NODE || child->GetType() == wxXML_CDATA_SECTION_NODE)
{
break;
}
child = child->GetNext();
}
child->SetContent(m_source);
MethodLua::Deserialize(root);
child->SetContent(m_pattern);
}
开发者ID:nocturnal,项目名称:FragmentShader,代码行数:18,代码来源:method.cpp
示例5: GetIntAttribute
int
GetIntAttribute(const wxXmlNode& node, const wxString& name, const wxString& def)
{
wxString value = GetStringAttribute(node, name, def);
long l;
if (!value.ToLong(&l, 0))
{
THROW("Attribute \"%s\" in element <%s> is not an integer.", name.c_str(), node.GetName().c_str());
}
return l;
}
开发者ID:nocturnal,项目名称:FragmentShader,代码行数:11,代码来源:xml.cpp
示例6: tkz
void
MethodList::Deserialize(const wxXmlNode& root)
{
m_choices.clear();
wxStringTokenizer tkz(root.GetNodeContent(), wxT(","));
while (tkz.HasMoreTokens())
{
wxString token = tkz.GetNextToken();
m_choices.insert(token.Trim().Trim(false));
}
Method::Deserialize(root);
}
开发者ID:nocturnal,项目名称:FragmentShader,代码行数:12,代码来源:method.cpp
示例7: wxXmlNode
void XmlStackWalker::OnStackFrame(const wxStackFrame& frame)
{
m_isOk = true;
wxXmlNode *nodeFrame = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("frame"));
m_nodeStack->AddChild(nodeFrame);
NumProperty(nodeFrame, wxT("level"), frame.GetLevel());
wxString func = frame.GetName();
if ( !func.empty() )
{
nodeFrame->AddAttribute(wxT("function"), func);
HexProperty(nodeFrame, wxT("offset"), frame.GetOffset());
}
if ( frame.HasSourceLocation() )
{
nodeFrame->AddAttribute(wxT("file"), frame.GetFileName());
NumProperty(nodeFrame, wxT("line"), frame.GetLine());
}
const size_t nParams = frame.GetParamCount();
if ( nParams )
{
wxXmlNode *nodeParams = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("parameters"));
nodeFrame->AddChild(nodeParams);
for ( size_t n = 0; n < nParams; n++ )
{
wxXmlNode *
nodeParam = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("parameter"));
nodeParams->AddChild(nodeParam);
NumProperty(nodeParam, wxT("number"), n);
wxString type, name, value;
if ( !frame.GetParam(n, &type, &name, &value) )
continue;
if ( !type.empty() )
TextElement(nodeParam, wxT("type"), type);
if ( !name.empty() )
TextElement(nodeParam, wxT("name"), name);
if ( !value.empty() )
TextElement(nodeParam, wxT("value"), value);
}
}
}
开发者ID:BloodRedd,项目名称:gamekit,代码行数:50,代码来源:debugrpt.cpp
示例8: DeleteAttribute
void
DeleteAttribute(wxXmlNode& node, const wxString& name)
{
wxXmlProperty *prop = node.GetProperties();
wxXmlProperty *prev = NULL;
while (prop != NULL)
{
if (prop->GetName() == name)
{
if (prev == NULL)
{
node.SetProperties(prop->GetNext());
}
else
{
prev->SetNext(prop->GetNext());
}
DESTROY(prop);
return;
}
prop = prop->GetNext();
}
}
开发者ID:nocturnal,项目名称:FragmentShader,代码行数:23,代码来源:xml.cpp
示例9: GetBoolAttribute
bool
GetBoolAttribute(const wxXmlNode& node, const wxString& name, const wxString& def)
{
wxString value = GetStringAttribute(node, name, def);
if (value == wxT("true"))
{
return true;
}
else if (value == wxT("false"))
{
return false;
}
else
{
THROW("Attribute \"%s\" in element <%s> is not a boolean.", name.c_str(), node.GetName().c_str());
}
}
开发者ID:nocturnal,项目名称:FragmentShader,代码行数:17,代码来源:xml.cpp
示例10: handle_impl
/// \brief Attempt to parse and dispatch the given event.
///
virtual seec::Maybe<seec::Error> handle_impl(wxXmlNode &Event)
{
// First parse all attributes into the Values tuple.
wxString ValueString;
for (auto &Attr : Attributes) {
if (!Event.GetAttribute(Attr->get_name(), &ValueString))
return error_attribute(Attr->get_name());
if (!Attr->from_string(Trace, ValueString.ToStdString()))
return error_attribute(Attr->get_name());
}
dispatch_from_tuple(IndexSeqTy{});
return seec::Maybe<seec::Error>();
}
开发者ID:mheinsen,项目名称:seec,代码行数:19,代码来源:ActionReplay.hpp
示例11: ParseXmlNode
void TwitterUser::ParseXmlNode(const wxXmlNode& node)
{
wxXmlNode *child = node.GetChildren();
while (child) {
const wxString& tagName = child->GetName();
wxString value = child->GetNodeContent();
if (tagName == _T("id")) {
id = strtoull(value.mb_str(), NULL, 10);
// value.ToULongLong(&id); (GCC doesn't like this)
}
else if (tagName == _T("name")) {
name = value;
}
else if (tagName == _T("screen_name")) {
screen_name = value;
}
else if (tagName == _T("description")) {
description = value;
}
else if (tagName == _T("location")) {
location = value;
}
else if (tagName == _T("profile_image_url")) {
profile_image_url = value;
}
else if (tagName == _T("url")) {
url = value;
}
else if (tagName == _T("protected")) {
protected_ = value == _T("true") ? true : false;
}
else if (tagName == _T("followers_count")) {
value.ToULong(&followers_count);
}
child = child->GetNext();
}
}
开发者ID:lsegal,项目名称:Twittle,代码行数:38,代码来源:twitter_user.cpp
示例12: SelectionObject
SelectionVOI::SelectionVOI( const wxXmlNode selObjNode, const wxString &rootPath )
: SelectionObject( selObjNode ),
m_voiSize( 0 ),
m_generationThreshold( 0.0f ),
m_thresType( THRESHOLD_INVALID ),
m_pIsoSurface( NULL ),
m_sourceAnatIndex( 0 )
{
m_objectType = VOI_TYPE;
wxXmlNode *pChildNode = selObjNode.GetChildren();
while( pChildNode != NULL )
{
wxString nodeName = pChildNode->GetName();
wxString propVal;
if( nodeName == wxT("voi_properties") )
{
double temp;
pChildNode->GetAttribute( wxT("gen_threshold"), &propVal );
propVal.ToDouble(&temp);
m_generationThreshold = temp;
pChildNode->GetAttribute( wxT("thres_op_type"), &propVal );
m_thresType = Helper::getThresholdingTypeFromString( propVal );
wxXmlNode *pAnatNode = pChildNode->GetChildren();
if( pAnatNode->GetName() == wxT("generation_anatomy") )
{
wxString anatPath = pAnatNode->GetNodeContent();
// Get full path, since this is how it is stored in the dataset.
wxFileName fullAnatPath( rootPath + wxFileName::GetPathSeparator() + anatPath );
// Find the anatomy related to this file.
vector< Anatomy* > anats = DatasetManager::getInstance()->getAnatomies();
for( vector< Anatomy* >::iterator anatIt( anats.begin() ); anatIt != anats.end(); ++anatIt )
{
if( (*anatIt)->getPath() == fullAnatPath.GetFullPath() )
{
m_sourceAnatIndex = (*anatIt)->getDatasetIndex();
break;
}
}
if( !m_sourceAnatIndex.isOk() )
{
wxString err( wxT("Anatomy: ") );
err << anatPath << wxT(" does not exist when creating VOI called: ") << getName() << wxT(".");
throw err;
}
Anatomy *pCurAnat = dynamic_cast< Anatomy* >( DatasetManager::getInstance()->getDataset( m_sourceAnatIndex ) );
buildSurface( pCurAnat );
}
}
pChildNode = pChildNode->GetNext();
}
}
开发者ID:aminvafaei,项目名称:fibernavigator,代码行数:61,代码来源:SelectionVOI.cpp
注:本文中的wxXmlNode类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论