common callback defines More...
Go to the source code of this file.
Functions | |
zfindex | ZFInputReadChar (zfchar *buf, const ZFInput &input) |
read single logic char to buf, return count of sizoef(zfchar) if success, or 0 if fail | |
zfindex | ZFInputReadChar (zfstring &buf, const ZFInput &input) |
see ZFInputReadChar | |
zfindex | ZFInputSkipChars (zfchar *buf, const ZFInput &input, const zfchar *charSet=" \t\r\n") |
util method to skip chars in set | |
zfindex | ZFInputReadUntil (zfstring &ret, const ZFInput &input, const zfchar *charSet=" \t\r\n", zfindex maxCount=((zfindex) -1), zfchar *firstMatchedChar=zft_zfnull) |
read until any char in charSet shows up, or reached maxCount, return count read so far | |
zfindex | ZFInputCheckMatch (const zfchar **tokens, zfindex tokenCount, const ZFInput &input) |
util method to check whether the input match the tokens | |
zfindex | ZFInputRead (const ZFOutput &output, const ZFInput &input, zfindex size=((zfindex) -1)) |
util method to read contents of input to output | |
zfindex | ZFInputRead (zfstring &ret, const ZFInput &input, zfindex size=((zfindex) -1)) |
util method to read contents from input to string | |
zfindex | ZFInputReadLine (const ZFOutput &output, const ZFInput &input) |
util method to read one line | |
zfindex | ZFInputReadLine (zfstring &output, const ZFInput &input) |
util method to read one line | |
void | ZFOutputRepeat (const ZFOutput &output, const zfchar *token, zfindex count) |
repeat output | |
ZFOutput | ZFOutputChain (const ZFOutput &o0, const ZFOutput &o1, const ZFOutput &o2=zft_zfnull, const ZFOutput &o3=zft_zfnull, const ZFOutput &o4=zft_zfnull, const ZFOutput &o5=zft_zfnull, const ZFOutput &o6=zft_zfnull, const ZFOutput &o7=zft_zfnull) |
util to create a chained output | |
ZFOutput | ZFOutputChain (const ZFCoreArray< ZFOutput > &o) |
util to create a chained output | |
common callback defines
read single logic char to buf, return count of sizoef(zfchar) if success, or 0 if fail
since UTF-8 has variable logic char size, use this method to read a single logic char
note: result may have more than one char for invalid encoding, and buf size must at least 9 byte size
|
extern |
util method to skip chars in set
return 0 if all chars are skipped before end, other wise, buf stores the first logic char (see ZFInputReadChar)
|
extern |
read until any char in charSet shows up, or reached maxCount, return count read so far
the first char matched charSet would be read and discarded, and you may check it by firstMatchedChar, if reached end or maxCount before matched charSet, 0 would be returned to firstMatchedChar
|
extern |
util method to check whether the input match the tokens
return token's index if match or zfindexMax() if no match or error, header white spaces would be skipped automatically
if no match, this method would try to restore the callback state by ioSeek to original position
|
extern |
util method to read contents of input to output
return size already written to output even if error occurred
util method to read contents from input to string
return size appended to string
util method to read one line
return size read for the line (excluding the endl), or 0 for empty line, or zfindexMax if failed
util method to read one line
return size read for the line (excluding the endl), or 0 for empty line, or zfindexMax if failed
note the result would be appended to the string
|
extern |
util to create a chained output
typical usage: