www.digitalmars.com

D Programming Language 2.0

Last update Wed Sep 2 00:11:55 2009

std.openrj

Open-RJ mapping for the D standard library.

Authors:
Matthew Wilson

References:
Open-RJ

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

string 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

string 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

string 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 string name();

final string value();

Record record();

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

uint numFields();

uint length();

Field[] fields();

Field opIndex(index_type index);

string opIndex(string fieldName);

Field getField(string fieldName);

Field findField(string fieldName);

int hasField(string fieldName);

Database database();

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

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

class Database;

this(string memory, uint flags);

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

size_type numRecords();

size_type numFields();

size_type numLines();

uint flags();

Record[] records();

Field[] fields();

uint length();

Record opIndex(index_type index);

Record[] getRecordsContainingField(string fieldName);

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

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

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