#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_begin (StringT const &any_text_) | |
Constructs and initializes the object. |
StringT | specifies type of the encapsulated string. |
Definition at line 2063 of file xtl_primary.h.
cttl_impl::xtl_text_begin< StringT >::xtl_text_begin | ( | StringT const & | any_text_ | ) |
size_t cttl_impl::xtl_text_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 2132 of file xtl_primary.h.
02133 { 02134 typename SubstrT::string_T const& str = edge_.parent(); 02135 size_t new_offset = str.find_first_of( m_any_text, edge_.first.offset() ); 02136 if ( new_offset != SubstrT::string_T::npos ) { 02137 // successful find 02138 // ending position is the same 02139 edge_.first.offset( new_offset ); 02140 CTTL_TRACE_TEXT_RESULT( true, '<', m_any_text.c_str() ); 02141 return new_offset; 02142 } 02143 02144 CTTL_TRACE_TEXT_RESULT( false, '<', m_any_text.c_str() ); 02145 return SubstrT::string_T::npos; 02146 }
size_t cttl_impl::xtl_text_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 2099 of file xtl_primary.h.
02100 { 02101 typename SubstrT::string_T const& str = edge_.parent(); 02102 if ( m_any_text.find( str[ edge_.first.offset() ] ) != SubstrT::string_T::npos ) { 02103 // successful match 02104 // ending position is the same 02105 CTTL_TRACE_TEXT_RESULT( true, '<', m_any_text.c_str() ); 02106 return edge_.first.offset(); 02107 } 02108 02109 CTTL_TRACE_TEXT_RESULT( false, '<', m_any_text.c_str() ); 02110 return SubstrT::string_T::npos; 02111 }