mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-30 08:38:15 +01:00
inlined getNodeId, skipWhitespace
This commit is contained in:
parent
08f2df96ba
commit
3e6b7695ad
3 changed files with 14 additions and 30 deletions
|
@ -38,6 +38,6 @@ DONE - xpath_variable_resolver.hpp
|
||||||
|
|
||||||
xpath_axis_enumerator.cpp
|
xpath_axis_enumerator.cpp
|
||||||
xpath_object.cpp
|
xpath_object.cpp
|
||||||
DONE - xpath_parser.cpp
|
GONE - xpath_parser.cpp
|
||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include <boost/spirit/core.hpp>
|
#include <boost/spirit/core.hpp>
|
||||||
#include <boost/spirit/tree/ast.hpp>
|
#include <boost/spirit/tree/ast.hpp>
|
||||||
|
|
||||||
|
#include "xpath_ast_ids.hpp"
|
||||||
|
|
||||||
namespace Arabica
|
namespace Arabica
|
||||||
{
|
{
|
||||||
namespace XPath
|
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 tree_match_t::tree_iterator node_iter_t;
|
||||||
typedef boost::spirit::tree_parse_info<str_iter_t> tree_info_t;
|
typedef boost::spirit::tree_parse_info<str_iter_t> tree_info_t;
|
||||||
|
|
||||||
long getNodeId(node_iter_t const& node);
|
inline long getNodeId(node_iter_t const& node)
|
||||||
node_iter_t& skipWhitespace(node_iter_t& 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 XPath
|
||||||
} // namespace Arabica
|
} // namespace Arabica
|
||||||
|
|
|
@ -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
|
|
Loading…
Add table
Reference in a new issue