Objectively 1.0.0
Ultra-lightweight object oriented framework for GNU C.
|
#include <StringReader.h>
The StringReader type.
Definition at line 47 of file StringReader.h.
Properties | |
char * | head |
The StringReader head. More... | |
Object | object |
The superclass. More... | |
String * | string |
The String to read. More... | |
![]() | |
Class * | clazz |
Every instance of Object begins with a pointer to its Class. More... | |
Methods | |
Class * | _StringReader (void) |
The StringReader archetype. More... | |
StringReader * | initWithCharacters (StringReader *self, const char *chars) |
Initializes this StringReader with the specified C string. More... | |
StringReader * | initWithString (StringReader *self, String *string) |
Initializes this StringReader with the specified String. More... | |
Unicode | next (StringReader *self) |
Unicode | next (StringReader *self, StringReaderMode mode) |
Consumes the next Unicode code point in this StringReader using the given mode. More... | |
Unicode | peek (StringReader *self) |
Peeks at the next Unicode code point from this StringReader without advancing head . More... | |
int | read (StringReader *self) |
Reads a single Unicode code point from this StringReader. More... | |
int | readToken (StringReader *self, const Unicode *charset, Unicode *stop) |
String * | readToken (StringReader *self, const Unicode *charset, Unocide *stop) |
Reads characters from this StringReader until a character in charset is encountered. More... | |
void | reset (StringReader *self) |
Resets this StringReader, placing the head before the beginning of the String. More... | |
![]() | |
Class * | _Object (void) |
The Object archetype. More... | |
Object * | copy (const Object *self) |
Creates a shallow copy of this Object. More... | |
void | dealloc (Object *self) |
Frees all resources held by this Object. More... | |
String * | description (const Object *self) |
int | hash (const Object *self) |
Object * | init (Object *self) |
Initializes this Object. More... | |
_Bool | isEqual (const Object *self, const Object *other) |
Tests equality of the other Object. More... | |
_Bool | isKindOfClass (const Object *self, const Class *clazz) |
Tests for Class hierarchy membership. More... | |
Protected Attributes | |
StringReaderInterface * | interface |
The interface. More... | |
![]() | |
ObjectInterface * | interface |
The interface. More... | |
char* StringReader::head |
The StringReader head.
Definition at line 63 of file StringReader.h.
|
protected |
The interface.
Definition at line 58 of file StringReader.h.
Object StringReader::object |
The superclass.
Definition at line 52 of file StringReader.h.
String* StringReader::string | ( | void | ) |
The String to read.
Definition at line 68 of file StringReader.h.
Class * _StringReader | ( | void | ) |
The StringReader archetype.
Definition at line 192 of file StringReader.c.
StringReader * initWithCharacters | ( | StringReader * | self, |
const char * | chars | ||
) |
Initializes this StringReader with the specified C string.
self | The StringReader. |
chars | The null-terminated C string to read. |
NULL
on error. Definition at line 64 of file StringReader.c.
StringReader * initWithString | ( | StringReader * | self, |
String * | string | ||
) |
Initializes this StringReader with the specified String.
self | The StringReader. |
string | The String to read. |
NULL
on error. Definition at line 79 of file StringReader.c.
Unicode next | ( | StringReader * | self | ) |
Unicode next | ( | StringReader * | self, |
StringReaderMode | mode | ||
) |
Consumes the next Unicode code point in this StringReader using the given mode.
self | The StringReader. |
mode | The StringReaderMode. |
-1
if the StringReader is exhausted. Definition at line 93 of file StringReader.c.
Unicode peek | ( | StringReader * | self | ) |
Peeks at the next Unicode code point from this StringReader without advancing head
.
self | The StringReader. |
-1
if the StringReader is exhausted. $(reader, next, StringReaderPeek)
. Definition at line 111 of file StringReader.c.
Unicode read | ( | StringReader * | self | ) |
Reads a single Unicode code point from this StringReader.
self | The StringReader. |
-1
if the StringReader is exhausted. $(reader, next, StringReaderRead)
. int readToken | ( | StringReader * | self, |
const Unicode * | charset, | ||
Unicode * | stop | ||
) |
Definition at line 127 of file StringReader.c.
String * readToken | ( | StringReader * | self, |
const Unicode * | charset, | ||
Unocide * | stop | ||
) |
Reads characters from this StringReader until a character in charset
is encountered.
self | The StringReader. |
charset | The array of potential stop characters. |
stop | Optionally returns the stop character from charset . |
stop
, or NULL
if the StringReader is exhausted. void reset | ( | StringReader * | self | ) |
Resets this StringReader, placing the head
before the beginning of the String.
self | The StringReader. |
Definition at line 165 of file StringReader.c.