15 #ifndef DATA_GRAMMAR_COMPARETOOL_HPP 16 #define DATA_GRAMMAR_COMPARETOOL_HPP 52 virtual __always_inline
int compare (
const char *s1,
const char *s2 ) {
53 return strcmp ( s1, s2 );
55 virtual __always_inline
int ncompare (
const char *s1,
const char *s2,
57 return strncmp ( s1, s2, n );
77 const char *nh = s_->c_str();
79 nh + rhs.
p ) <= 0 )
return 95 virtual __always_inline
int compare (
const char *s1,
98 for ( ; *s1 == *s2 || ( *s1 >=
'A' && *s1 <= 'Z' && *s2 >=
'A' 99 && *s2 <=
'Z' ); ++s1, ++s2 ) {
100 if ( *s1 ==
' ' )
return 102 if ( *s1 == 0 )
return 0;
103 if ( *s2 >=
'A' && *s2 <=
'Z' )
while ( * ( s2 + 1 ) !=
'_' 104 && * ( s2 + 1 ) !=
' ' && * ( s2 + 1 ) !=
'\0' ) s2++;
105 if ( *s1 >=
'A' && *s1 <=
'Z' )
while ( * ( s1 + 1 ) !=
'_' 106 && * ( s1 + 1 ) !=
' ' && * ( s1 + 1 ) !=
'\0' ) s1++;
108 return * (
const unsigned char * ) s1 - * (
const unsigned char * ) s2;
112 virtual __always_inline
int ncompare (
const char *s1,
const char *s2,
116 while ( n-- > 0 && ( *s1 == *s2 || ( *s1 ==
'X' && *s2 >=
'A' 117 && *s2 <=
'Z' ) ) ) {
118 if ( n == 0 || *s1 ==
'\0' )
return 0;
120 if ( *s2 >=
'A' && *s2 <=
'Z' )
while ( * ( s2 + 1 ) !=
'_' 121 && * ( s2 + 1 ) !=
' ' ) s2++;
124 unsigned char uc1, uc2;
125 uc1 = ( * (
unsigned char * ) s1 );
126 uc2 = ( * (
unsigned char * ) s2 );
std::size_t order
absolute index
PosIndexCompare(std::string *c, CompareTool *myct)
Struct containing rule positions and offsets.
Functor Class that provides comparison accross the posindex structure. This is typically used e...