QDBM for C++: qdbm::Datum Class Reference

# qdbm::Datum Class Reference

Datum of records for ADBM. More...

List of all members.

## Public Member Functions
| Datum (const char *dptr="", int dsize=-1)
| Create an instance.
| Datum (int num)
| Create an instance.
| Datum (const Datum &datum)
| Copy constructor.
virtual | ~Datum () throw ()
| Release resources of the instance.
Datum & | operator= (const Datum &datum)
| Assignment operator.
Datum & | operator= (const char *str)
| Assignment operator.
virtual Datum & | operator<< (const Datum &datum)
| Concatenation operator.
virtual Datum & | operator<< (const char *str)
| Concatenation operator.
virtual bool | operator== (const Datum &datum) const
| Equality operator.
virtual bool | operator!= (const Datum &datum) const
| Inequality operator.
virtual bool | operator== (const char *str) const
| Equality operator.
virtual bool | operator!= (const char *str) const
| Inequality operator.
virtual char & | operator[] (int idx) const
| Subscripting operator.
virtual | operator const char * () const
| Cast operator into pointer to char.
virtual const char * | ptr () const
| Get the pointer of the region of the datum.
virtual int | size () const
| Get the size of the region of the datum.
## Friends
class | qdbm::Depot
class | qdbm::Curia
class | qdbm::Villa
Datum | qdbm::operator+ (const Datum &former, const Datum &latter)
Datum | qdbm::operator+ (const Datum &datum, const char *str)
Datum | qdbm::operator+ (const char *str, const Datum &datum)

## Detailed Description

Datum of records for ADBM.

## Constructor & Destructor Documentation

qdbm::Datum::Datum | ( | const char * | dptr = `""`,
|  | int | dsize = `-1` |
| ) |  |  |

Create an instance.

Parameters:

  | dptr | the pointer to the region of data.
  | dsize | the size of the region. If it is negative, the size is assigned with `stdstrlen(dptr)'.

qdbm::Datum::Datum | ( | int | num | ) |

Create an instance.

Parameters:

  | num | an integer number.

qdbm::Datum::Datum | ( | const Datum & | datum | ) |

Copy constructor.

Parameters:

  | datum | a source instance.

## Member Function Documentation

virtual qdbm::Datum::operator const char * | ( |  | ) | const`[virtual]`

Cast operator into pointer to char.

Returns:
  the pointer of the region of the datum.

Note:
  Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string.

virtual bool qdbm::Datum::operator!= | ( | const char * | str | ) | const`[virtual]`

Inequality operator.

Parameters:

  | str | a comparing string.

Returns:
  true if both do not equal, else, false.

virtual bool qdbm::Datum::operator!= | ( | const Datum & | datum | ) | const`[virtual]`

Inequality operator.

Parameters:

  | datum | a comparing instance.

Returns:
  true if both do not equal, else, false.

virtual Datum& qdbm::Datum::operator<< | ( | const char * | str | ) | `[virtual]`

Concatenation operator.

Parameters:

  | str | a latter string.

Returns:
  reference to itself.

virtual Datum& qdbm::Datum::operator<< | ( | const Datum & | datum | ) | `[virtual]`

Concatenation operator.

Parameters:

  | datum | a latter instance.

Returns:
  reference to itself.

Datum& qdbm::Datum::operator= | ( | const char * | str | ) |

Assignment operator.

Parameters:

  | str | a source string.

Returns:
  reference to itself.

Datum& qdbm::Datum::operator= | ( | const Datum & | datum | ) |

Assignment operator.

Parameters:

  | datum | a source instance.

Returns:
  reference to itself.

virtual bool qdbm::Datum::operator== | ( | const char * | str | ) | const`[virtual]`

Equality operator.

Parameters:

  | str | a comparing string.

Returns:
  true if both equal, else, false.

virtual bool qdbm::Datum::operator== | ( | const Datum & | datum | ) | const`[virtual]`

Equality operator.

Parameters:

  | datum | a comparing instance.

Returns:
  true if both equal, else, false.

virtual char& qdbm::Datum::operator[] | ( | int | idx | ) | const`[virtual]`

Subscripting operator.

Parameters:

  | idx | the index of a character.

Returns:
  reference of the character.

virtual const char* qdbm::Datum::ptr | ( |  | ) | const`[virtual]`

Get the pointer of the region of the datum.

Returns:
  the pointer of the region of the datum.

Note:
  Because an additional zero code is appended at the end of the region of the return value, the return value can be treated as a character string.

virtual int qdbm::Datum::size | ( |  | ) | const`[virtual]`

Get the size of the region of the datum.

Returns:
  the size of the region of the datum.

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

- xadbm.h