inlined getNodeId, skipWhitespace

This commit is contained in:
jez_higgins 2005-08-17 12:28:20 +00:00
parent 08f2df96ba
commit 3e6b7695ad
3 changed files with 14 additions and 30 deletions

View file

@ -38,6 +38,6 @@ DONE - xpath_variable_resolver.hpp
xpath_axis_enumerator.cpp
xpath_object.cpp
DONE - xpath_parser.cpp
GONE - xpath_parser.cpp
*/
#endif

View file

@ -4,6 +4,8 @@
#include <boost/spirit/core.hpp>
#include <boost/spirit/tree/ast.hpp>
#include "xpath_ast_ids.hpp"
namespace Arabica
{
namespace XPath
@ -15,8 +17,17 @@ typedef boost::spirit::tree_match<str_iter_t> tree_match_t;
typedef tree_match_t::tree_iterator node_iter_t;
typedef boost::spirit::tree_parse_info<str_iter_t> tree_info_t;
long getNodeId(node_iter_t const& node);
node_iter_t& skipWhitespace(node_iter_t& node);
inline long getNodeId(node_iter_t const& node)
{
return static_cast<long>(node->value.id().to_long());
} // getNodeId
inline node_iter_t& skipWhitespace(node_iter_t& node)
{
while(getNodeId(node) == impl::S_id)
++node;
return node;
} // skipWhitespace
} // namespace XPath
} // namespace Arabica

View file

@ -1,27 +0,0 @@
#ifdef _MSC_VER
#pragma warning(disable:4224 4180 4244)
#endif
#include <XPath/impl/xpath_parser.hpp>
namespace Arabica
{
namespace XPath
{
long getNodeId(node_iter_t const& node)
{
return static_cast<long>(node->value.id().to_long());
} // getNodeId
node_iter_t& skipWhitespace(node_iter_t& node)
{
while(getNodeId(node) == impl::S_id)
++node;
return node;
} // skipWhitespace
} // namespace XPath
} // namespace Arabica
// end