CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
strscan.h File Reference

Cursor-based string scanner for hand-written parsers. More...

Go to the source code of this file.

Data Structures

struct  strscan
 

Macros

#define strscInit(sc, s, ...)   _strscInit(sc, s, opt_flags(__VA_ARGS__))
 
#define strscVal(sc, type, pval)   _strscVal(sc, stCheckedPtrArg(type, pval))
 

Typedefs

typedef struct strscan strscan
 

Enumerations

enum  STRSC_FLAGS { STRSC_CaseInsensitive = 0x01 }
 Flags controlling how a scanner matches. More...
 

Functions

bool strscFinish (strscan *sc)
 
bool strscDone (strscan *sc)
 
int32 strscMark (strscan *sc)
 
void strscRewind (strscan *sc, int32 mark)
 
bool strscSeek (strscan *sc, int32 pos)
 
void strscFail (strscan *sc)
 
bool strscLit (strscan *sc, strref lit)
 
bool strscChar (strscan *sc, char ch)
 
bool strscTry (strscan *sc, strref lit)
 
bool strscTryChar (strscan *sc, char ch)
 
bool strscPeek (strscan *sc, strref lit)
 
uint8 strscPeekChar (strscan *sc)
 
bool strscWS (strscan *sc)
 
bool strscWS1 (strscan *sc)
 
bool strscToken (strscan *sc, string *out, strref delims)
 
bool strscUntil (strscan *sc, string *out, strref text)
 
bool strscWhile (strscan *sc, string *out, strref chars)
 
bool strscQuoted (strscan *sc, string *out)
 
bool strscLine (strscan *sc, string *out)
 
bool strscRest (strscan *sc, string *out)
 
void strscSpan (strscan *sc, int32 *off, int32 *len)
 
bool strscInt32 (strscan *sc, int32 *out, int base)
 
bool strscUInt32 (strscan *sc, uint32 *out, int base)
 
bool strscInt64 (strscan *sc, int64 *out, int base)
 
bool strscUInt64 (strscan *sc, uint64 *out, int base)
 
bool strscFloat32 (strscan *sc, float32 *out)
 
bool strscFloat64 (strscan *sc, float64 *out)
 
bool strscBool (strscan *sc, bool *out)
 

Detailed Description

Cursor-based string scanner for hand-written parsers.

Definition in file strscan.h.