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),
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,...)
wchar_t Unicode
The Unicode type.
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.
Condition * init(Condition *self)
Initializes this Condition.
MutableString * initWithString(MutableString *self, const String *string)
Initializes this MutableString with the contents of string.
Object is the root Class of The Objectively Class hierarchy.
Class * _Object(void)
The Object archetype.
Object * copy(const Object *self)
Creates a shallow copy of this Object.
void dealloc(Object *self)
Frees all resources held by this Object.
void start(Operation *self)
Starts this Operation.
A location and length into contiguous collections.
ssize_t location
The location.
char * chars
The backing null-terminated UTF-8 encoded character array.
String * initWithCharacters(String *self, const char *chars)
Initializes this String by copying chars.
String * substring(const String *string, const Range range)
Creates a new String from a subset of this one.
OBJECTIVELY_EXPORT String * str(const char *fmt,...)
A convenience function for instantiating Strings.
Unicode peek(StringReader *self)
Peeks at the next Unicode code point from this StringReader without advancing head.
int read(StringReader *self)
Reads a single Unicode code point from this StringReader.
Unicode next(StringReader *self)
char * head
The StringReader head.
Class * _StringReader(void)
The StringReader archetype.
void reset(StringReader *self)
Resets this StringReader, placing the head before the beginning of the String.
String * string
The String to read.
int readToken(StringReader *self, const Unicode *charset, Unicode *stop)