Main Page Namespace List Class Hierarchy Compound List Compound Members

# qdbm::Datum Class Reference

List of all members.

## Detailed Description

Datum of records for ADBM.

## 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.
virtual Datum & | operator= (const Datum &datum)
| Assignment operator.
virtual 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 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.
virtual void | cjack (char *dptr, int dsize)
| Replace the contents with a C-style allocated region.

## 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 `std::strlen(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 void qdbm::Datum::cjack | ( | char * | dptr,
|  | int | dsize
| ) | `[virtual]`

Replace the contents with a C-style allocated region.

Parameters:

  dptr | the region allocated with `std::malloc' or `std::realloc'.
  dsize | the size of the region.

Note:
  the specified region is released with `std::free' at the destruction of the instance.

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

Inequality operator.

Parameters:

  str | a comparing string.

Returns:
  true if the 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 the 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.

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

Assignment operator.

Parameters:

  str | a source string.

Returns:
  reference to itself.

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

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 the both equal, else, false.

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

Equality operator.

Parameters:

  datum | a comparing instance.

Returns:
  true if the both equal, else, false.

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