ICU-329 Move syntaxError body to header file

X-SVN-Rev: 5499
This commit is contained in:
Ram Viswanadha 2001-08-17 01:41:40 +00:00
parent 61e489cacd
commit 5f44db3f6b

View File

@ -240,8 +240,26 @@ protected:
inline void syntaxError(const UnicodeString& pattern,
int32_t pos,
UParseError& parseError,
UErrorCode& status);
UParseError& parseError){
parseError.offset = pos;
parseError.line=0; // we are not using line number
// for pre-context
int32_t start = (pos <=U_PARSE_CONTEXT_LEN)? 0 : (pos - (U_PARSE_CONTEXT_LEN-1
/* subtract 1 so that we have room for null*/));
int32_t stop = pos;
pattern.extract(start,stop,parseError.preContext,0);
//null terminate the buffer
parseError.preContext[stop-start] = 0;
//for post-context
start = pos+1;
stop = ((pos+U_PARSE_CONTEXT_LEN)<=pattern.length()) ? (pos+(U_PARSE_CONTEXT_LEN-1)) :
pattern.length();
pattern.extract(start,stop,parseError.postContext,0);
//null terminate the buffer
parseError.postContext[stop-start]= 0;
}
};
#endif // _FORMAT