|
|
|
|
|
|
|||
This the the root namespace for Open-RJ, and contains the C-API functions, along with enumerations and structures.
Classes | |
| struct | IORJAllocator |
| Allocator interface for Open-RJ. More... | |
| struct | ORJStringA |
| The string type (for ANSI coding). More... | |
| struct | ORJFieldA |
| The field type (for ANSI coding). More... | |
| struct | ORJRecordA |
| The record type (for ANSI coding). More... | |
| struct | ORJDatabaseA |
| The database type (for ANSI coding). More... | |
| struct | ORJError |
| Parsing error structure. More... | |
Namespaces | |
| namespace | cpp |
| The namespace of the Open-RJ/C++ mapping. | |
| namespace | stl |
| The namespace of the Open-RJ/STL mapping. | |
Common types | |
| typedef char | orj_char_t |
| Character type used by Open-RJ. | |
| enum | ORJ_FLAG { ORJ_FLAG_ORDERFIELDS = 0x0001, ORJ_FLAG_ELIDEBLANKRECORDS = 0x0002, ORJ_FLAG_IGNORECASEONLOOKUP = 0x0004, ORJ_FLAG_NOREINTERPRETFIELDIDS = 0x0100, ORJ_FLAG_FORCEALLFIELDSINTO1RECORD = 0x0008 } |
| The flags passed to the database creation functions. More... | |
| enum | ORJRC { ORJ_RC_SUCCESS = 0, ORJ_RC_CANNOTOPENJARFILE, ORJ_RC_NORECORDS, ORJ_RC_OUTOFMEMORY, ORJ_RC_BADFILEREAD, ORJ_RC_PARSEERROR, ORJ_RC_INVALIDINDEX, ORJ_RC_UNEXPECTED, ORJ_RC_INVALIDCONTENT } |
| The return code type of the Open-RJ API. More... | |
| enum | ORJ_PARSE_ERROR { ORJ_PARSE_SUCCESS = 0, ORJ_PARSE_RECORDSEPARATORINCONTINUATION, ORJ_PARSE_UNFINISHEDLINE, ORJ_PARSE_UNFINISHEDFIELD, ORJ_PARSE_UNFINISHEDRECORD, ORJ_PARSE_INVALIDFIELDNAME } |
| Parsing error constants. More... | |
Database manipulation functions | |
| ORJRC | ORJ_ReadDatabaseA (char const *jarName, IORJAllocator *ator, unsigned flags, ORJDatabaseA const **pdatabase, ORJError *error) |
| Reads the records from the given file into an Open-RJ databsae. | |
| ORJRC | ORJ_CreateDatabaseFromMemoryA (char const *contents, size_t cbContents, IORJAllocator *ator, unsigned flags, ORJDatabaseA const **pdatabase, ORJError *error) |
| Reads the records from the memory block into an Open-RJ databsae. | |
| ORJRC | ORJ_FreeDatabaseA (ORJDatabaseA const *database) |
| Frees the resources associated with the database. | |
| size_t | ORJ_Database_GetNumLinesA (ORJDatabaseA const *database) |
| Gives the number of lines in a database. | |
| size_t | ORJ_Database_GetNumFieldsA (ORJDatabaseA const *database) |
| Gives the number of fields in a database. | |
| size_t | ORJ_Database_GetNumRecordsA (ORJDatabaseA const *database) |
| Gives the number of records in a database. | |
| ORJRC | ORJ_Database_GetRecordA (ORJDatabaseA const *database, size_t iRecord, ORJRecordA const **precord) |
| Retrieves a record in the database. | |
| ORJRC | ORJ_Database_GetFieldA (ORJDatabaseA const *database, size_t iField, ORJFieldA const **pfield) |
| Retrieves a field in the database. | |
Record manipulation functions | |
| These functions may be used instead of direct manipulation of the data structures, which may be necessary when mapping the API to other languages which can only deal in opaque values and function calls (e.g. JNI). | |
| size_t | ORJ_Record_GetNumFieldsA (ORJRecordA const *record) |
| Gives the number of fields in a record. | |
| ORJRC | ORJ_Record_GetFieldA (ORJRecordA const *record, size_t iField, ORJFieldA const **pfield) |
| Gives the number of field in a record. | |
| ORJFieldA const * | ORJ_Record_FindFieldByNameA (ORJRecordA const *record, char const *fieldName, char const *fieldValue) |
| Finds a field in a record, based on the name and, optionally, the value. | |
| ORJFieldA const * | ORJ_Record_FindNextFieldA (ORJRecordA const *record, ORJFieldA const *fieldAfter, char const *fieldName, char const *fieldValue) |
| Finds a field in a record, relative to a specified field, based on optional name and/or value. | |
| ORJDatabaseA const * | ORJ_Record_GetDatabaseA (ORJRecordA const *record) |
| Gives the database associated with the record. | |
| ORJRC | ORJ_Record_GetCommentA (ORJRecordA const *record, ORJStringA const **pcomment) |
| Gives the record comment. | |
Field manipulation functions | |
| These functions may be used instead of direct manipulation of the data structures, which may be necessary when mapping the API to other languages which can only deal in opaque values and function calls (e.g. JNI). | |
| ORJRC | ORJ_Field_GetNameA (ORJFieldA const *field, ORJStringA const **pname) |
| Gives the name of a field. | |
| ORJRC | ORJ_Field_GetValueA (ORJFieldA const *field, ORJStringA const **pvalue) |
| Gives the value of a field. | |
| ORJRC | ORJ_Field_GetNameAndValueA (ORJFieldA const *field, ORJStringA const **pname, ORJStringA const **pvalue) |
| Gives the name and value of a field. | |
| ORJRecordA const * | ORJ_Field_GetRecordA (ORJFieldA const *field) |
| Gives the record associated with the field. | |
Error functions | |
| char const * | ORJ_GetErrorStringA (ORJRC errorCode) |
| Gives the name of the error. | |
| size_t | ORJ_GetErrorStringLengthA (ORJRC errorCode) |
| Gives the length of the error string returned by ORJ_GetErrorStringA(). | |
| char const * | ORJ_GetParseErrorStringA (ORJ_PARSE_ERROR errorCode) |
| Gives the name of the parse-error. | |
| size_t | ORJ_GetParseErrorStringLengthA (ORJ_PARSE_ERROR errorCode) |
| Gives the length of the error string returned by ORJ_GetParseErrorStringA(). | |
String access shims | |
| These functions are string access shims for injection into the stlsoft namespace, in order to facilitate generalised manipulation of the ORJStringA, ORJRC and ORJ_PARSE_ERROR types. | |
| char const * | c_str_ptr_null_a (ORJStringA const &s) |
| Nul-terminated, possibly NULL, C-string representation of the given ORJStringA instance. | |
| char const * | c_str_ptr_null (ORJStringA const &s) |
| Nul-terminated, possibly NULL, C-string representation of the given ORJStringA instance. | |
| char const * | c_str_ptr_a (ORJStringA const &s) |
| Nul-terminated C-string representation of the given ORJStringA instance. | |
| char const * | c_str_ptr (ORJStringA const &s) |
| Nul-terminated C-string representation of the given ORJStringA instance. | |
| char const * | c_str_data_a (ORJStringA const &s) |
| Nul-terminated C-string representation of the given ORJStringA instance. | |
| char const * | c_str_data (ORJStringA const &s) |
| Nul-terminated C-string representation of the given ORJStringA instance. | |
| size_t | c_str_len_a (ORJStringA const &s) |
| Length of the C-string representation of the given ORJStringA instance. | |
| size_t | c_str_len (ORJStringA const &s) |
| Length of the C-string representation of the given ORJStringA instance. | |
| char const * | c_str_ptr_null_a (ORJRC rc) |
| Nul-terminated, possibly NULL, C-string representation of the given ORJRC instance. | |
| char const * | c_str_ptr_null (ORJRC rc) |
| Nul-terminated, possibly NULL, C-string representation of the given ORJRC instance. | |
| char const * | c_str_ptr_a (ORJRC rc) |
| Nul-terminated C-string representation of the given ORJRC instance. | |
| char const * | c_str_ptr (ORJRC rc) |
| Nul-terminated C-string representation of the given ORJRC instance. | |
| char const * | c_str_data_a (ORJRC rc) |
| Not necessarily nul-terminated C-string representation of the given ORJRC instance. | |
| char const * | c_str_data (ORJRC rc) |
| Not necessarily nul-terminated C-string representation of the given ORJRC instance. | |
| size_t | c_str_len_a (ORJRC rc) |
| Length of the C-string representation of the given ORJRC instance. | |
| size_t | c_str_len (ORJRC rc) |
| Length of the C-string representation of the given ORJRC instance. | |
| char const * | c_str_ptr_null_a (ORJ_PARSE_ERROR pe) |
| Nul-terminated, possibly NULL, C-string representation of the given ORJ_PARSE_ERROR instance. | |
| char const * | c_str_ptr_null (ORJ_PARSE_ERROR pe) |
| Nul-terminated, possibly NULL, C-string representation of the given ORJ_PARSE_ERROR instance. | |
| char const * | c_str_ptr_a (ORJ_PARSE_ERROR pe) |
| Nul-terminated C-string representation of the given ORJ_PARSE_ERROR instance. | |
| char const * | c_str_ptr (ORJ_PARSE_ERROR pe) |
| Nul-terminated C-string representation of the given ORJ_PARSE_ERROR instance. | |
| char const * | c_str_data_a (ORJ_PARSE_ERROR pe) |
| Not necessarily nul-terminated C-string representation of the given ORJ_PARSE_ERROR instance. | |
| char const * | c_str_data (ORJ_PARSE_ERROR pe) |
| Not necessarily nul-terminated C-string representation of the given ORJ_PARSE_ERROR instance. | |
| size_t | c_str_len (ORJ_PARSE_ERROR pe) |
| Length of the C-string representation of the given ORJ_PARSE_ERROR instance. | |
| size_t | c_str_len_a (ORJ_PARSE_ERROR pe) |
| Length of the C-string representation of the given ORJ_PARSE_ERROR instance. | |
Stream insertion shims | |
| These functions are stream insertion shims for allowing the ORJStringA, ORJRC and ORJ_PARSE_ERROR types to be used with stream instances, a la the IOStreams. For example:
ORJRecord *record = . . . ; std::cout << record->fields[0] << std::end; // Prints the value of the 0th field in the record ORJRC rc = ORJ_RC_INVALIDINDEX; std::cout << rc << std::end; // Prints "An invalid index was specified" ORJ_PARSE_ERROR pe = ORJ_PARSE_UNFINISHEDLINE; std::cout << pe << std::end; // Prints "The last line in the database was not terminated by a line-feed" | |
| template<class S> | |
| S & | operator<< (S &stm, ORJStringA const &s) |
| Inserts an ORJStringA instance into a stream. | |
| template<class S> | |
| S & | operator<< (S &stm, ORJRC rc) |
| Inserts an ORJRC instance into a stream. | |
| template<class S> | |
| S & | operator<< (S &stm, ORJ_PARSE_ERROR pe) |
| Inserts an ORJ_PARSE_ERROR instance into a stream. | |
Functions | |
| ORJRC | ORJ_ReadDatabase (orj_char_t const *jarName, IORJAllocator *ator, unsigned flags, ORJDatabase const **pdatabase, ORJError *error) |
| Reads the records from the given file into an Open-RJ databsae. | |
| ORJRC | ORJ_CreateDatabaseFromMemory (orj_char_t const *contents, size_t cbContents, IORJAllocator *ator, unsigned flags, ORJDatabaseA const **pdatabase, ORJError *error) |
| Reads the records from the memory block into an Open-RJ databsae. | |
| ORJRC | ORJ_FreeDatabase (ORJDatabase const *database) |
| Frees the resources associated with the database. | |
| typedef char orj_char_t |
Character type used by Open-RJ.
| enum ORJ_FLAG |
The flags passed to the database creation functions.
| enum ORJRC |
The return code type of the Open-RJ API.
| enum ORJ_PARSE_ERROR |
Parsing error constants.
| ORJRC openrj::ORJ_ReadDatabaseA | ( | char const * | jarName, | |
| IORJAllocator * | ator, | |||
| unsigned | flags, | |||
| ORJDatabaseA const ** | pdatabase, | |||
| ORJError * | error | |||
| ) |
Reads the records from the given file into an Open-RJ databsae.
| jarName | Name of the Record-JAR file. May not be NULL | |
| ator | The allocator to use for allocating memory, May be NULL, in which case CRT malloc() / realloc() / free() are used | |
| flags | Combination of the ORJ_FLAG enumeration | |
| error | Pointer to an error structure, which is filled out with information if a parsing error is encountered | |
| pdatabase | Pointer to a database pointer, in which will be returned the database. May not be NULL. The returned pointer must be freed using ORJ_FreeDatabaseA(). |
| ORJRC openrj::ORJ_CreateDatabaseFromMemoryA | ( | char const * | contents, | |
| size_t | cbContents, | |||
| IORJAllocator * | ator, | |||
| unsigned | flags, | |||
| ORJDatabaseA const ** | pdatabase, | |||
| ORJError * | error | |||
| ) |
Reads the records from the memory block into an Open-RJ databsae.
| contents | Pointer to the base of the memory contents to parse. May not be NULL | |
| cbContents | Number of bytes in the memory contents to parse | |
| ator | The allocator to use for allocating memory, May be NULL, in which case CRT malloc() / realloc() / free() are used | |
| flags | Combination of the ORJ_FLAG enumeration | |
| error | Pointer to an error structure, which is filled out with information if a parsing error is encountered | |
| pdatabase | Pointer to a database pointer, in which will be returned the database. May not be NULL. The returned pointer must be freed using ORJ_FreeDatabaseA(). |
| ORJRC openrj::ORJ_FreeDatabaseA | ( | ORJDatabaseA const * | database | ) |
Frees the resources associated with the database.
| database | The database. May not be NULL |
| size_t openrj::ORJ_Database_GetNumLinesA | ( | ORJDatabaseA const * | database | ) |
Gives the number of lines in a database.
| database | The database. May not be NULL |
| size_t openrj::ORJ_Database_GetNumFieldsA | ( | ORJDatabaseA const * | database | ) |
Gives the number of fields in a database.
| database | The database. May not be NULL |
| size_t openrj::ORJ_Database_GetNumRecordsA | ( | ORJDatabaseA const * | database | ) |
Gives the number of records in a database.
| database | The database. May not be NULL |
| ORJRC openrj::ORJ_Database_GetRecordA | ( | ORJDatabaseA const * | database, | |
| size_t | iRecord, | |||
| ORJRecordA const ** | precord | |||
| ) |
Retrieves a record in the database.
| database | The database from which the record is to be retrieved | |
| iRecord | Index of the record to be retrieved | |
| precord | Pointer to a record pointer. The returned value points at the requested record stucture |
| ORJRC openrj::ORJ_Database_GetFieldA | ( | ORJDatabaseA const * | database, | |
| size_t | iField, | |||
| ORJFieldA const ** | pfield | |||
| ) |
Retrieves a field in the database.
| database | The database from which the field is to be retrieved | |
| iField | Index of the field to be retrieved | |
| pfield | Pointer to a field pointer. The returned value points at the requested field stucture |
| size_t openrj::ORJ_Record_GetNumFieldsA | ( | ORJRecordA const * | record | ) |
Gives the number of fields in a record.
| record | The record. May not be NULL |
| ORJRC openrj::ORJ_Record_GetFieldA | ( | ORJRecordA const * | record, | |
| size_t | iField, | |||
| ORJFieldA const ** | pfield | |||
| ) |
Gives the number of field in a record.
| record | The record from which to retrieve the field | |
| iField | Index of the field to be retrieved | |
| pfield | Pointer to a field pointer. The returned value points at the requested field stucture |
| ORJFieldA const* openrj::ORJ_Record_FindFieldByNameA | ( | ORJRecordA const * | record, | |
| char const * | fieldName, | |||
| char const * | fieldValue | |||
| ) |
Finds a field in a record, based on the name and, optionally, the value.
| record | The record from which to retrieve the field | |
| fieldName | The name of the field | |
| fieldValue | The value of the field. May be NULL, in which case the first record with the given name will be returned, irrespective of its value. |
| ORJFieldA const* openrj::ORJ_Record_FindNextFieldA | ( | ORJRecordA const * | record, | |
| ORJFieldA const * | fieldAfter, | |||
| char const * | fieldName, | |||
| char const * | fieldValue | |||
| ) |
Finds a field in a record, relative to a specified field, based on optional name and/or value.
| record | The record from which to retrieve the field | |
| fieldAfter | The field to start the search from. NULL to get the first field. | |
| fieldName | The name of the field. May be NULL for no filtering on name | |
| fieldValue | The value of the field. May be NULL for no filtering on value |
| ORJDatabaseA const* openrj::ORJ_Record_GetDatabaseA | ( | ORJRecordA const * | record | ) |
Gives the database associated with the record.
| record | The record. May not be NULL |
| ORJRC openrj::ORJ_Record_GetCommentA | ( | ORJRecordA const * | record, | |
| ORJStringA const ** | pcomment | |||
| ) |
Gives the record comment.
| record | The record from which to retrieve the field | |
| pcomment | Pointer to a comment pointer. The returned value points at the comment |
| ORJRC openrj::ORJ_Field_GetNameA | ( | ORJFieldA const * | field, | |
| ORJStringA const ** | pname | |||
| ) |
Gives the name of a field.
| field | The field whose name is to be retrieved | |
| pname | Pointer to a string pointer. The returned value points at a string structure representing the name |
| ORJRC openrj::ORJ_Field_GetValueA | ( | ORJFieldA const * | field, | |
| ORJStringA const ** | pvalue | |||
| ) |
Gives the value of a field.
| field | The field whose value is to be retrieved | |
| pvalue | Pointer to a string pointer. The returned value points at a string structure representing the value |
| ORJRC openrj::ORJ_Field_GetNameAndValueA | ( | ORJFieldA const * | field, | |
| ORJStringA const ** | pname, | |||
| ORJStringA const ** | pvalue | |||
| ) |
Gives the name and value of a field.
| field | The field whose value is to be retrieved | |
| pname | Pointer to a string pointer. The returned value points at a string structure representing the name | |
| pvalue | Pointer to a string pointer. The returned value points at a string structure representing the value |
| ORJRecordA const* openrj::ORJ_Field_GetRecordA | ( | ORJFieldA const * | field | ) |
Gives the record associated with the field.
| field | The field. May not be NULL |
| char const* openrj::ORJ_GetErrorStringA | ( | ORJRC | errorCode | ) |
Gives the name of the error.
| errorCode | The error whose name is to be retrieved |
| size_t openrj::ORJ_GetErrorStringLengthA | ( | ORJRC | errorCode | ) |
Gives the length of the error string returned by ORJ_GetErrorStringA().
| errorCode | The error whose name is to be retrieved |
| char const* openrj::ORJ_GetParseErrorStringA | ( | ORJ_PARSE_ERROR | errorCode | ) |
Gives the name of the parse-error.
| errorCode | The parse-error whose name is to be retrieved |
| size_t openrj::ORJ_GetParseErrorStringLengthA | ( | ORJ_PARSE_ERROR | errorCode | ) |
Gives the length of the error string returned by ORJ_GetParseErrorStringA().
| errorCode | The error whose name is to be retrieved |
| ORJRC openrj::ORJ_ReadDatabase | ( | orj_char_t const * | jarName, | |
| IORJAllocator * | ator, | |||
| unsigned | flags, | |||
| ORJDatabase const ** | pdatabase, | |||
| ORJError * | error | |||
| ) | [inline] |
Reads the records from the given file into an Open-RJ databsae.
| ORJRC openrj::ORJ_CreateDatabaseFromMemory | ( | orj_char_t const * | contents, | |
| size_t | cbContents, | |||
| IORJAllocator * | ator, | |||
| unsigned | flags, | |||
| ORJDatabaseA const ** | pdatabase, | |||
| ORJError * | error | |||
| ) | [inline] |
Reads the records from the memory block into an Open-RJ databsae.
| ORJRC openrj::ORJ_FreeDatabase | ( | ORJDatabase const * | database | ) | [inline] |
Frees the resources associated with the database.
|
|
| Open-RJ Library documentation © Synesis Software Pty Ltd, 2004-2005 |