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

file_database Class Reference

#include <openrj/stl/database.hpp>

Inheritance diagram for file_database:

database_base List of all members.

Detailed Description

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

example_stl_5.cpp.


Public Types

typedef file_database class_type
 This type.
typedef record value_type
 The value type.
typedef value_type const const_reference
 The non-mutating (const) reference type.
typedef value_type const * const_pointer
 The non-mutating (const) pointer type.
typedef ptrdiff_t difference_type
 The difference type.
typedef size_t size_type
 The size type.
typedef stlsoft::proxy_iterator<
const ORJField, field, proxy_traits_type,
std::random_access_iterator_tag,
field
const_field_iterator
 The non-mutating (const) iterator type for enumerating all fields in the database.
typedef stlsoft::const_reverse_iterator_base<
const_field_iterator, field,
field, void, difference_type
const_reverse_field_iterator
 The non-mutating (const) reverse iterator type.
typedef size_t distance_type
 The distance type.
typedef stlsoft::indirect_reverse_iterator<
const_iterator, value_type,
value_type, void, difference_type,
std::random_access_iterator_tag > 
const_reverse_iterator
 The non-mutating (const) reverse iterator type.

Public Member Functions

 file_database (char const *jarName, unsigned flags=0)
 Constructs a database instance from the given database file, and the optional flags.
template<typename S>
 file_database (S const &jarName, unsigned flags=0)
 Constructs a database instance from the given database file, and the optional flags.
size_t num_lines () const
 Returns the number of lines in the database.
size_t num_fields () const
 Returns the number of fields in the database.
size_t num_records () const
 Returns the number of records in the database.
size_t size () const
 Returns the number of records in the database.
const record operator[] (size_t index) const
 Returns the requested record.
const_iterator begin () const
 Begins the iteration.
const_iterator end () const
 Ends the iteration.
const_reverse_iterator rbegin () const
 Begins the reverse iteration.
const_reverse_iterator rend () const
 Ends the reverse iteration.


Member Typedef Documentation

typedef file_database class_type

This type.

Reimplemented from database_base.

typedef stlsoft::proxy_iterator<const ORJField , field , proxy_traits_type , std::random_access_iterator_tag , field > const_field_iterator [inherited]

The non-mutating (const) iterator type for enumerating all fields in the database.

typedef value_type const* const_pointer [inherited]

The non-mutating (const) pointer type.

typedef value_type const const_reference [inherited]

The non-mutating (const) reference type.

typedef stlsoft:: const_reverse_iterator_base< const_field_iterator , field , field , void , difference_type > const_reverse_field_iterator [inherited]

The non-mutating (const) reverse iterator type.

typedef stlsoft:: indirect_reverse_iterator< const_iterator , value_type , value_type , void , difference_type , std::random_access_iterator_tag > const_reverse_iterator [inherited]

The non-mutating (const) reverse iterator type.

typedef ptrdiff_t difference_type [inherited]

The difference type.

typedef size_t distance_type [inherited]

The distance type.

typedef size_t size_type [inherited]

The size type.

typedef record value_type [inherited]

The value type.


Constructor & Destructor Documentation

file_database ( char const *  jarName,
unsigned  flags = 0 
) [inline, explicit]

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

Parameters:
jarName The database name
flags Combination of the ORJ_FLAG enumeration

file_database ( S const &  jarName,
unsigned  flags = 0 
) [inline, explicit]

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

Parameters:
jarName The database name
flags Combination of the ORJ_FLAG enumeration


Member Function Documentation

database_base::const_iterator begin (  )  const [inline, inherited]

Begins the iteration.

Returns:
A non-mutating (const) iterator representing the start of the sequence
Examples:
example_stl_2.cpp, and example_stl_3.cpp.

database_base::const_iterator end (  )  const [inline, inherited]

Ends the iteration.

Returns:
A non-mutating (const) iterator representing the end of the sequence
Examples:
example_stl_2.cpp, and example_stl_3.cpp.

size_t num_fields (  )  const [inline, inherited]

Returns the number of fields in the database.

Examples:
example_stl_1.cpp, example_stl_2.cpp, example_stl_3.cpp, and example_stl_7.cpp.

size_t num_lines (  )  const [inline, inherited]

Returns the number of lines in the database.

Examples:
example_stl_1.cpp, example_stl_2.cpp, example_stl_3.cpp, and example_stl_7.cpp.

size_t num_records (  )  const [inline, inherited]

Returns the number of records in the database.

Examples:
example_stl_1.cpp, example_stl_2.cpp, example_stl_3.cpp, and example_stl_7.cpp.

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 size()

database_base::const_reverse_iterator rbegin (  )  const [inline, inherited]

Begins the reverse iteration.

Returns:
A non-mutating (const) iterator representing the start of the reverse sequence

database_base::const_reverse_iterator rend (  )  const [inline, inherited]

Ends the reverse iteration.

Returns:
A non-mutating (const) iterator representing the end of the reverse sequence

size_t size (  )  const [inline, inherited]

Returns the number of records in the database.

Examples:
example_stl_1.cpp, and example_stl_7.cpp.


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

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