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

Pattern-based text parsing, the reading counterpart to strFormat. More...

#include <cx/container/sarray.h>
#include <cx/cx.h>
#include <cx/string.h>
#include <cx/stype/stvar.h>
#include <cx/utils/lazyinit.h>

Go to the source code of this file.

Data Structures

struct  StrPatternDecl
 
struct  ParseVar
 Parse variable descriptor for Parsable interface implementations. More...
 

Macros

#define strPatternCreate(pat, ...)   _strPatternCreate(pat, opt_flags(__VA_ARGS__))
 
#define strPatternMatch(pat, s, ...)    _strPatternMatch(pat, s, count_macro_args(__VA_ARGS__), (stvp[]) { __VA_ARGS__ })
 
#define strPatternMatchAt(io_pos, pat, s, ...)    _strPatternMatchAt(io_pos, pat, s, count_macro_args(__VA_ARGS__), (stvp[]) { __VA_ARGS__ })
 
#define strParse(s, pat, ...)    _strParse(s, pat, count_macro_args(__VA_ARGS__), (stvp[]) { __VA_ARGS__ })
 
#define STR_PATTERN(name, patstr, ...)    _STR_PATTERN_DECL(name, _strpat_##name, patstr, opt_flags(__VA_ARGS__))
 
#define strPat(name)   _strPatGet(&name)
 

Typedefs

typedef struct StrPattern StrPattern
 
typedef struct StrPatternDecl StrPatternDecl
 
typedef struct ParseVar ParseVar
 Parse variable descriptor for Parsable interface implementations.
 

Enumerations

enum  STRPAT_FLAGS { STRPAT_ExactWS = 0x01 , STRPAT_CaseI = 0x02 }
 Flags controlling how a pattern is compiled and matched. More...
 
enum  PARSEVarFlags { PARSEVar_CaseInsensitive = 0x0001 , PARSEVar_Trim = 0x0002 , PARSEVar_Upper = 0x0004 , PARSEVar_Lower = 0x0008 }
 Parse variable flags for Parsable interface implementations. More...
 

Functions

void strPatternDestroy (StrPattern **pat)
 

Detailed Description

Pattern-based text parsing, the reading counterpart to strFormat.

Definition in file parse.h.