www.digitalmars.com

D Programming Language 1.0

Last update Mon Dec 31 10:53:29 2012

std.openrj

Open-RJ mapping for the D standard library.

Authors:
Matthew Wilson

References:
Open-RJ

Source:
std/openrj.d

enum ORJ_FLAG;
Flags that moderate the creation of Databases

ORDER_FIELDS
Arranges the fields in alphabetical order

ELIDE_BLANK_RECORDS
Causes blank records to be ignored

char[] toString(ORJ_FLAG f);


enum ORJRC;
General error codes

SUCCESS
Operation was successful

CANNOT_OPEN_JAR_FILE
The given file does not exist, or cannot be accessed

NO_RECORDS
The database file contained no records

OUT_OF_MEMORY
The API suffered memory exhaustion

BAD_FILE_READ
A read operation failed

PARSE_ERROR
Parsing of the database file failed due to a syntax error

INVALID_INDEX
An invalid index was specified

UNEXPECTED
An unexpected condition was encountered

INVALID_CONTENT
The database file contained invalid content

char[] toString(ORJRC f);


enum ORJ_PARSE_ERROR;
Parsing error codes

SUCCESS
Parsing was successful

RECORD_SEPARATOR_IN_CONTINUATION
A record separator was encountered during a content line continuation

UNFINISHED_LINE
The last line in the database was not terminated by a line-feed

UNFINISHED_FIELD
The last field in the database file was not terminated by a record separator

UNFINISHED_RECORD
The last record in the database file was not terminated by a record separator

char[] toString(ORJ_PARSE_ERROR f);


class OpenRJException: object.Exception;


class DatabaseException: std.openrj.OpenRJException;


ORJRC rc();


ORJ_PARSE_ERROR parseError();


int lineNum();


class InvalidKeyException: std.openrj.OpenRJException;


class InvalidTypeException: std.openrj.OpenRJException;


class Field;
Represents a field in the database

final char[] name();


final char[] value();


Record record();


class Record;
Represents a record in the database, consisting of a set of fields

size_t numFields();


size_t length();


Field[] fields();


Field opIndex(index_type index);


char[] opIndex(char[] fieldName);


Field getField(char[] fieldName);


Field findField(char[] fieldName);


int hasField(char[] fieldName);


Database database();


int opApply(int delegate(ref Field field) dg);


int opApply(int delegate(char[] name, char[] value) dg);


class Database;


this(char[] memory, uint flags);


this(char[][] lines, uint flags);


size_type numRecords();


size_type numFields();


size_type numLines();


uint flags();


Record[] records();


Field[] fields();


size_t length();


Record opIndex(index_type index);


Record[] getRecordsContainingField(char[] fieldName);


Record[] getRecordsContainingField(char[] fieldName, char[] fieldValue);


int opApply(int delegate(ref Record record) dg);


int opApply(int delegate(ref Field field) dg);