Buteo Synchronization Framework: Buteo::StorageItem Class Reference

Buteo Synchronization Framework

Public Member Functions | List of all members
Buteo::StorageItem Class Referenceabstract

Class to describe a storable item. More...

`#include <StorageItem.h>`

## Public Member Functions
| StorageItem ()
| Constructor.
virtual | ~StorageItem ()
| Destructor.
void | setId (const QString &aId)
| Sets the id of the item. More...
const QString & | getId () const
| Returns the id of the item. More...
void | setParentId (const QString &aParentId)
| Sets the id of the parent of this item. More...
const QString & | getParentId () const
| Returns the id of the parent of this item. More...
void | setType (const QString &aType)
| Sets the type of this item. More...
const QString & | getType () const
| Gets the type of this item. More...
void | setVersion (const QString &aVersion)
| Sets the version of this item. More...
const QString & | getVersion () const
| Gets the version of this item. More...
virtual bool | write (qint64 aOffset, const QByteArray &aData)=0
| Write (part of) the item data. More...
virtual bool | read (qint64 aOffset, qint64 aLength, QByteArray &aData) const =0
| Read (part of) the item data. More...
virtual bool | resize (qint64 aLen)=0
| Sets the length of the item data. More...
virtual qint64 | getSize () const =0
| Get the size of the item data. More...

## Detailed Description

Class to describe a storable item.

## Member Function Documentation

## ◆ getId()

const QString & StorageItem::getId | ( |  | ) | const

Returns the id of the item.

Returns
  Id of the item

## ◆ getParentId()

const QString & StorageItem::getParentId | ( |  | ) | const

Returns the id of the parent of this item.

Returns
  Id of the parent of this item

## ◆ getSize()

virtual qint64 Buteo::StorageItem::getSize | ( |  | ) | const
| pure virtual

Get the size of the item data.

Returns
  The data size in bytes

## ◆ getType()

const QString & StorageItem::getType | ( |  | ) | const

Gets the type of this item.

Returns
  Type of this item

## ◆ getVersion()

const QString & StorageItem::getVersion | ( |  | ) | const

Gets the version of this item.

Returns
  Version of this item

## ◆ read()

virtual bool Buteo::StorageItem::read | ( | qint64 | aOffset,
|  | qint64 | aLength,
|  | QByteArray & | aData
| ) |  | const
| pure virtual

Read (part of) the item data.

Parameters

  aOffset | The offset in bytes from where the data is read
  aLength | The number of bytes to read
  aData | Data buffer where to place data

Returns
  True on success, otherwise false

## ◆ resize()

virtual bool Buteo::StorageItem::resize | ( | qint64 | aLen | ) |
| pure virtual

Sets the length of the item data.

Parameters

  aLen | Length to set for item data

Returns
  True on success, otherwise false

## ◆ setId()

void StorageItem::setId | ( | const QString & | aId | ) |

Sets the id of the item.

Parameters

  aId | The id of the item

## ◆ setParentId()

void StorageItem::setParentId | ( | const QString & | aParentId | ) |

Sets the id of the parent of this item.

Parameters

  aParentId | The id of the parent of item

## ◆ setType()

void StorageItem::setType | ( | const QString & | aType | ) |

Sets the type of this item.

Parameters

  aType | Type of this item

## ◆ setVersion()

void StorageItem::setVersion | ( | const QString & | aVersion | ) |

Sets the version of this item.

Parameters

  aVersion | Version of this item

## ◆ write()

virtual bool Buteo::StorageItem::write | ( | qint64 | aOffset,
|  | const QByteArray & | aData
| ) |  |
| pure virtual

Write (part of) the item data.

Parameters

  aOffset | Offset to start writing from
  aData | Data buffer to write. All bytes from buffer are written

Returns
  True on success, otherwise false

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

- StorageItem.h
- StorageItem.cpp