00001 #include <spl/xml/xpath/private/XPathOpNamedNode.h> 00002 00003 00004 XPathOpNamedNode::XPathOpNamedNode(const String& nodeName) 00005 : m_nodeName(nodeName) 00006 { 00007 } 00008 00009 XPathOpNamedNode::XPathOpNamedNode(const XPathOpNamedNode& op) 00010 { 00011 m_nodeName = op.m_nodeName; 00012 } 00013 00014 XPathOpNamedNode::~XPathOpNamedNode() 00015 { 00016 } 00017 00018 XPathOpNamedNode& XPathOpNamedNode::operator =(const XPathOpNamedNode& oproot) 00019 { 00020 m_nodeName = oproot.m_nodeName; 00021 return *this; 00022 } 00023 00024 bool XPathOpNamedNode::IsMatch(XmlNode& context) 00025 { 00026 return context.Name() == m_nodeName; 00027 } 00028 00029 XmlNodeListPtr XPathOpNamedNode::NextContext(XmlNodePtr context) 00030 { 00031 ASSERT(IsMatch(context)); 00032 XmlNodeListPtr nodes = XmlNodeListPtr(new XmlNodeList()); 00033 nodes->Add(context); 00034 return nodes; 00035 } 00036 00037 #if defined(DEBUG) || defined(_DEBUG) 00038 void XPathOpNamedNode::CheckMem() const 00039 { 00040 XPathOperator::CheckMem(); 00041 m_nodeName.CheckMem(); 00042 } 00043 00044 void XPathOpNamedNode::ValidateMem() const 00045 { 00046 XPathOperator::ValidateMem(); 00047 m_nodeName.ValidateMem(); 00048 } 00049 #endif