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

record Class Reference

#include <openrj/stl/record.hpp>

List of all members.


Detailed Description

This class represents a record in the database.
Examples:

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


Public Types

typedef record class_type
 This type.
typedef field 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 stlsoft::indirect_reverse_iterator<
const_iterator, value_type,
value_type, void, difference_type,
stlsoft_ns_qual_std(random_access_iterator_tag) > 
const_reverse_iterator
 The non-mutating (const) reverse iterator type.

Public Member Functions

 record (ORJRecord const *record)
 Conversion constructor.
 record ()
 Default constructor.
 record (record const &rhs)
 Copy constructor.
recordoperator= (record const &rhs)
 Copy assignment operator.
size_t size () const
 Returns the number of fields in the record.
bool empty () const
 Indicates whether the record is empty.
string_t comment () const
 Returns the record comment string.
const field operator[] (size_t index) const
 Returns the requested field.
bool has_field (string_t const &name) const
 Indicates whether the record contains one or more fields of the given name.
size_t count_fields (string_t const &name) const
 Indicates the number of contained fields with the given name.
const string_t operator[] (string_t const &name) const
 Returns the value of the first field with the given name.
string_t get_field_value (string_t const &name, string_t const &defValue) const
 Returns the value of the first field of the given name, or the given default if none exists.
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 record class_type

This type.

typedef value_type const* const_pointer

The non-mutating (const) pointer type.

typedef value_type const const_reference

The non-mutating (const) reference type.

typedef stlsoft:: indirect_reverse_iterator< const_iterator , value_type , value_type , void , difference_type , stlsoft_ns_qual_std(random_access_iterator_tag) > const_reverse_iterator

The non-mutating (const) reverse iterator type.

typedef ptrdiff_t difference_type

The difference type.

typedef field value_type

The value type.


Constructor & Destructor Documentation

record ( ORJRecord const *  record  )  [inline, explicit]

Conversion constructor.

record (  )  [inline]

Default constructor.

record ( record const &  rhs  )  [inline]

Copy constructor.


Member Function Documentation

record::const_iterator begin (  )  const [inline]

Begins the iteration.

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

string_t comment (  )  const [inline]

Returns the record comment string.

size_t count_fields ( string_t const &  name  )  const [inline]

Indicates the number of contained fields with the given name.

bool empty (  )  const [inline]

Indicates whether the record is empty.

record::const_iterator end (  )  const [inline]

Ends the iteration.

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

string_t get_field_value ( string_t const &  name,
string_t const &  defValue 
) const [inline]

Returns the value of the first field of the given name, or the given default if none exists.

Parameters:
name The name of the field whose value will be returned
defValue The default value returned if the named field does not exist
Returns:
The value of the named field if found, or defValue

bool has_field ( string_t const &  name  )  const [inline]

Indicates whether the record contains one or more fields of the given name.

record & operator= ( record const &  rhs  )  [inline]

Copy assignment operator.

const string_t operator[] ( string_t const &  name  )  const [inline]

Returns the value of the first field with the given name.

Parameters:
name The name of the field whose value will be returned. If not present, then an instance of std::out_of_range is thrown
Returns:
The value of the named field. There is no error return

const field operator[] ( size_t  index  )  const [inline]

Returns the requested field.

Parameters:
index The index of the field to be returned. Must be less than the value returned by size()
Returns:
The field corresponding to the given index

record::const_reverse_iterator rbegin (  )  const [inline]

Begins the reverse iteration.

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

record::const_reverse_iterator rend (  )  const [inline]

Ends the reverse iteration.

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

size_t size (  )  const [inline]

Returns the number of fields in the record.


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

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