#include <xtl_primary.h>
Public Member Functions | |
template<typename SubstrT > | |
size_t | internal_find (SubstrT &edge_) |
Implements search evaluation grammar evaluation algorithm. | |
template<typename SubstrT > | |
size_t | internal_match (SubstrT &edge_) |
Implements match evaluation grammar evaluation algorithm. | |
xtl_text_ref_begin (StringT const *str_ptr_) | |
Constructs and initializes the object. |
StringT | specifies type of the encapsulated string. |
Definition at line 2162 of file xtl_primary.h.
cttl_impl::xtl_text_ref_begin< StringT >::xtl_text_ref_begin | ( | StringT const * | str_ptr_ | ) |
size_t cttl_impl::xtl_text_ref_begin< StringT >::internal_find | ( | SubstrT & | edge_ | ) |
Implements search evaluation grammar evaluation algorithm.
SubstrT | specifies type of the parseable substring. Can be either cttl::const_edge or cttl::edge . |
edge_ | reference to the parseable substring. |
SubstrT::string_T::npos
, indicating that the evaluation algorithm has failed. Definition at line 2236 of file xtl_primary.h.
02237 { 02238 typename SubstrT::string_T const& str = edge_.parent(); 02239 size_t new_offset = str.find_first_of( m_any_text, edge_.first.offset() ); 02240 if ( new_offset != SubstrT::string_T::npos ) { 02241 // successful find 02242 // ending position is the same 02243 edge_.first.offset( new_offset ); 02244 CTTL_TRACE_TEXT_RESULT( true, '<', m_any_text.c_str() ); 02245 return new_offset; 02246 } 02247 02248 CTTL_TRACE_TEXT_RESULT( false, '<', m_any_text.c_str() ); 02249 return SubstrT::string_T::npos; 02250 }
size_t cttl_impl::xtl_text_ref_begin< StringT >::internal_match | ( | SubstrT & | edge_ | ) |
Implements match evaluation grammar evaluation algorithm.
SubstrT | specifies type of the parseable substring. Can be either cttl::const_edge or cttl::edge . |
edge_ | reference to the parseable substring. |
SubstrT::string_T::npos
, indicating that the evaluation algorithm has failed. Definition at line 2203 of file xtl_primary.h.
02204 { 02205 typename SubstrT::string_T const& str = edge_.parent(); 02206 if ( m_any_text.find( str[ edge_.first.offset() ] ) != SubstrT::string_T::npos ) { 02207 // successful match 02208 // ending position is current 02209 CTTL_TRACE_TEXT_RESULT( true, '<', m_any_text.c_str() ); 02210 return edge_.first.offset(); 02211 } 02212 02213 CTTL_TRACE_TEXT_RESULT( false, '<', m_any_text.c_str() ); 02214 return SubstrT::string_T::npos; 02215 }