20 #ifndef __AMODTOKENIZER_INC__
21 #define __AMODTOKENIZER_INC__
49 HasLineFeed = HasNewLine,
51 HasWhites = HasSpaces | HasTabs | HasNewLine | HasCR,
60 HasLeadingWhites = 0x0400,
61 HasTrailingWhites = 0x0800,
62 HasMiddleWhites = 0x1000,
63 IsAllWhites = 0x2000 | HasLeadingWhites | HasMiddleWhites | HasTrailingWhites,
66 UpperCaseLetters = 0x8000
71 { i_start = -1; i_end = -1; flags = 0; }
75 bool isAllWhite (
void )
const
76 {
return ( flags & IsAllWhites ) == IsAllWhites; }
78 bool leadingWhite (
void )
const
79 {
return ( flags & HasLeadingWhites ) == HasLeadingWhites; }
81 bool trailingWhite (
void )
const
82 {
return ( flags & HasTrailingWhites ) == HasTrailingWhites; }
84 bool middleWhite (
void )
const
85 {
return ( flags & HasMiddleWhites ) == HasMiddleWhites; }
87 bool hasWhiteSpaces (
void )
const
88 {
return ( flags & HasWhites ) != 0; }
90 bool hasDigits (
void )
const
91 {
return ( flags & HasDigits ) != 0; }
93 bool hasLetters (
void )
const
94 {
return ( flags & HasLetters ) != 0; }
96 bool hasComma (
void )
const
97 {
return ( flags & HasComma ) != 0; }
99 bool hasDot (
void )
const
100 {
return ( flags & HasDot ) != 0; }
102 bool hasLowCodes (
void )
const
103 {
return ( flags & HasLowCodes ) == HasLowCodes; }
105 bool hasUpperCaseLetters (
void )
const
106 {
return ( flags & UpperCaseLetters ) == UpperCaseLetters; }
108 bool hasLowerCaseLetters (
void )
const
109 {
return ( ( flags & UpperCaseLetters ) == 0 ) && hasLetters(); }
112 bool isInteger (
void )
const
114 return ( isAllWhite() ==
false ) &&
115 ( middleWhite() == false ) &&
117 ( hasLetters() == false );
120 bool isHexInteger (
void )
const
122 return ( isAllWhite() ==
false ) &&
123 ( middleWhite() == false ) &&
124 ( ( flags & OnlyHex ) == OnlyHex );
127 bool wasQuoted (
void )
const
128 {
return ( flags & WasQuoted ) == WasQuoted; }
150 QString getToken (
int i )
const
151 {
return s_.mid( tk_.at( i ).i_start, tk_.at( i ).i_end - tk_.at( i ).i_start ); }
167 bool isString (
const QString & s_match,
int i )
const;
177 bool isString (
int i )
const;
187 bool isString (
const AaToken & tk )
const;
193 bool isInteger (
int i )
const;
199 bool isInteger (
const AaToken & tk )
const;
205 bool isHexInteger (
int i )
const;
211 bool isHexInteger (
const AaToken & tk )
const;
265 static AaTkString basicTk (
const QString & s );
283 #endif // __AMODTOKENIZER_INC__