Open-RJ C/C++ User's Journal Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

MemoryDatabase Class Reference

#include <openrj/cpp/memorydatabase.hpp>

Inheritance diagram for MemoryDatabase:

DatabaseBase List of all members.

Detailed Description

This class opens and provides access to a memory-based Open-RJ database.
Examples:

example_cpp_1.cpp, example_cpp_2.cpp, example_cpp_3.cpp, example_cpp_5.cpp, and example_cpp_6.cpp.


Public Member Functions

State
bool is_open () const
 Indicates whether the database is open.
Attributes
size_t GetNumLines () const
 Returns the number of lines in the database.
size_t GetNumFields () const
 Returns the number of fields in the database.
size_t GetNumRecords () const
 Returns the number of records in the database.
Accessors
const Record GetRecord (size_t index) const
 Returns the requested record.
const Record operator[] (size_t index) const
 Returns the requested record.
const Record operator[] (int index) const
 Returns the requested record.
const Field GetField (size_t index) const
 Returns the requested record.
State
bool is_open () const
 Indicates whether the database is open.
Attributes
size_t GetNumLines () const
 Returns the number of lines in the database.
size_t GetNumFields () const
 Returns the number of fields in the database.
size_t GetNumRecords () const
 Returns the number of records in the database.
Accessors
const Record GetRecord (size_t index) const
 Returns the requested record.
const Record operator[] (size_t index) const
 Returns the requested record.
const Record operator[] (int index) const
 Returns the requested record.
const Field GetField (size_t index) const
 Returns the requested record.
Construction
 MemoryDatabase (char const *contents, size_t cbContents, unsigned flags=0)
 Constructs a database instance from the given memory, and the optional flags.
virtual ~MemoryDatabase ()
 Closes the database.
virtual void Close ()
 Closes the database.
State
bool is_open () const
 Indicates whether the database is open.
Attributes
size_t GetNumLines () const
 Returns the number of lines in the database.
size_t GetNumFields () const
 Returns the number of fields in the database.
size_t GetNumRecords () const
 Returns the number of records in the database.
Accessors
const Record GetRecord (size_t index) const
 Returns the requested record.
const Record operator[] (size_t index) const
 Returns the requested record.
const Record operator[] (int index) const
 Returns the requested record.
const Field GetField (size_t index) const
 Returns the requested record.


Constructor & Destructor Documentation

MemoryDatabase ( char const *  contents,
size_t  cbContents,
unsigned  flags = 0 
) [inline, explicit]

Constructs a database instance from the given memory, and the optional flags.

Parameters:
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
flags Combination of the ORJ_FLAG enumeration

virtual ~MemoryDatabase (  )  [inline, virtual]

Closes the database.


Member Function Documentation

virtual void Close (  )  [inline, virtual]

Closes the database.

Reimplemented from DatabaseBase.

const Field GetField ( size_t  index  )  const [inline, inherited]

Returns the requested record.

Parameters:
index The index of the record to be returned. Must be less than the value returned by GetNumRecords()
Examples:
example_cpp_5.cpp.

size_t GetNumFields (  )  const [inline, inherited]

Returns the number of fields in the database.

Examples:
example_cpp_1.cpp, example_cpp_2.cpp, example_cpp_5.cpp, and example_cpp_6.cpp.

size_t GetNumLines (  )  const [inline, inherited]

Returns the number of lines in the database.

Examples:
example_cpp_1.cpp, example_cpp_2.cpp, and example_cpp_6.cpp.

size_t GetNumRecords (  )  const [inline, inherited]

Returns the number of records in the database.

Examples:
example_cpp_1.cpp, example_cpp_2.cpp, and example_cpp_6.cpp.

const Record GetRecord ( size_t  index  )  const [inline, inherited]

Returns the requested record.

Parameters:
index The index of the record to be returned. Must be less than the value returned by GetNumRecords()

bool is_open (  )  const [inline, inherited]

Indicates whether the database is open.

const Record operator[] ( int  index  )  const [inline, inherited]

Returns the requested record.

Parameters:
index The index of the record to be returned. Must be less than the value returned by GetNumRecords()

const Record operator[] ( size_t  index  )  const [inline, inherited]

Returns the requested record.

Parameters:
index The index of the record to be returned. Must be less than the value returned by GetNumRecords()


The documentation for this class was generated from the following file:

Open-RJ Library documentation © Synesis Software Pty Ltd, 2004-2005