32#define _Class _StringReader
58#pragma mark - StringReader
96 const int bytes = mbtowc(&c, self->
head, MB_CUR_MAX);
131 if (c ==
READER_EOF || wcschr(charset, c) == NULL) {
151 const Range range = {
169#pragma mark - Class lifecycle
198 .name =
"StringReader",
202 .interfaceSize =
sizeof(StringReaderInterface),
static Array * init(Array *self)
ident release(ident obj)
Atomically decrement the given Object's reference count. If the resulting reference count is 0,...
Class * _initialize(const ClassDef *def)
Initializes the given Class.
ident retain(ident obj)
Atomically increment the given Object's reference count.
#define alloc(type)
Allocate and initialize and instance of type.
#define super(type, obj, method,...)
static void start(Operation *self)
String * str(const char *fmt,...)
static String * substring(const String *self, const Range range)
wchar_t Unicode
The Unicode type.
static StringReader * initWithString(StringReader *self, String *string)
static void reset(StringReader *self)
static Unicode next(StringReader *self, StringReaderMode mode)
static StringReader * initWithCharacters(StringReader *self, const char *chars)
static Unicode peek(StringReader *self)
static String * readToken(StringReader *self, const Unicode *charset, Unicode *stop)
static void dealloc(Object *self)
Class * _StringReader(void)
static Object * copy(const Object *self)
static void initialize(Class *clazz)
static Unicode stringReaderRead(StringReader *self)
StringReaders provide convenient parsing of text based files.
#define do_once(once, block)
Executes the given block at most one time.
ClassDefs are passed to _initialize via an archetype to initialize a Class.
The runtime representation of a Class.
ident interface
The interface of the Class.
Object is the root Class of The Objectively Class hierarchy.
void dealloc(Object *self)
Frees all resources held by this Object.
A location and length into contiguous collections.
ssize_t location
The location.
char * chars
The backing null-terminated UTF-8 encoded character array.
StringReader * initWithString(StringReader *self, String *string)
Initializes this StringReader with the specified String.
Unicode next(StringReader *self)
char * head
The StringReader head.
String * string
The String to read.