scim::TransactionReader Class Reference
SocketCommunication

This class is used to read data from a transaction without changing it. More...

`#include <scim_transaction.h>`

## Public Member Functions

| TransactionReader ()
| Default constructor.
| TransactionReader (const Transaction &trans)
| Constructor.
| ~TransactionReader ()
| Destructor.
| TransactionReader (const TransactionReader &)
| Copy constructor.
const TransactionReader & | operator= (const TransactionReader &)
| Copy operator.
void | attach (const Transaction &trans)
| Attach this TransactionReader object to a Transaction.
void | detach ()
| Detach this TransactionReader object from currently attached Transaction object.
bool | valid () const
| Check if the transaction reader is valid.
TransactionDataType | get_data_type () const
| Get the type of the data at current read position.
bool | get_command (int &cmd)
| Get a command from current read position.
bool | get_data (uint32 &val)
| Get an uint32 value from current read position.
bool | get_data (String &str)
| Get a String from current read position.
bool | get_data (WideString &str)
| Get a WideString from current read position.
bool | get_data (KeyEvent &key)
| Get a KeyEvent from current read position.
bool | get_data (AttributeList &attrs)
| Get an AttributeList from current read position.
bool | get_data (Property &property)
| Get a Property from current read position.
bool | get_data (PropertyList &properties)
| Get a PropertyList from current read position.
bool | get_data (CommonLookupTable &table)
| Get a CommonLookupTable from current read position.
bool | get_data (std::vector< uint32 > &vec)
| Get a std::vector<uint32> from current read position.
bool | get_data (std::vector< String > &vec)
| Get a std::vector<String> from current read position.
bool | get_data (std::vector< WideString > &vec)
| Get a std::vector<WideString> from current read position.
bool | get_data (char **raw, size_t &bufsize)
| Get a raw buffer from current read position.
bool | get_data (Transaction &trans)
| Get a Transaction object from current read position.
bool | skip_data ()
| Skip one data from current read position.
void | rewind ()
| Rewind the current read position, then the data can be read again.

## Detailed Description

This class is used to read data from a transaction without changing it.

## Constructor & Destructor Documentation

## TransactionReader() [1/3]

scim::TransactionReader::TransactionReader | ( |  | ) |

Default constructor.

Construct an empty TransactionReader object.

Referenced by operator=(), and TransactionReader().

## TransactionReader() [2/3]

scim::TransactionReader::TransactionReader | ( | const Transaction & | trans | ) |

Constructor.

Construct a TransactionReader object and attach to a Transaction object.

Parameters

  trans | The Transaction to be read.

## ~TransactionReader()

scim::TransactionReader::~TransactionReader | ( |  | ) |

Destructor.

## TransactionReader() [3/3]

scim::TransactionReader::TransactionReader | ( | const TransactionReader & |  | ) |

Copy constructor.

References TransactionReader().

## Member Function Documentation

## operator=()

const TransactionReader & scim::TransactionReader::operator= | ( | const TransactionReader & |  | ) |

Copy operator.

References TransactionReader().

## attach()

void scim::TransactionReader::attach | ( | const Transaction & | trans | ) |

Attach this TransactionReader object to a Transaction.

An empty TransactionReader object must be attached to a Transaction object before reading.

Parameters

  trans | The Transaction object to be read.

## detach()

void scim::TransactionReader::detach | ( |  | ) |

Detach this TransactionReader object from currently attached Transaction object.

## valid()

bool scim::TransactionReader::valid | ( |  | ) | const

Check if the transaction reader is valid.

Returns
  true if this TransactionReader object is attached to a Transaction object and ready to be read.

## get_data_type()

TransactionDataType scim::TransactionReader::get_data_type | ( |  | ) | const

Get the type of the data at current read position.

Returns
  The type of the data can be read currently.

## get_command()

bool scim::TransactionReader::get_command | ( | int & | cmd | ) |

Get a command from current read position.

## get_data() [1/13]

bool scim::TransactionReader::get_data | ( | uint32 & | val | ) |

Get an uint32 value from current read position.

## get_data() [2/13]

bool scim::TransactionReader::get_data | ( | String & | str | ) |

Get a String from current read position.

## get_data() [3/13]

bool scim::TransactionReader::get_data | ( | WideString & | str | ) |

Get a WideString from current read position.

## get_data() [4/13]

bool scim::TransactionReader::get_data | ( | KeyEvent & | key | ) |

Get a KeyEvent from current read position.

## get_data() [5/13]

bool scim::TransactionReader::get_data | ( | AttributeList & | attrs | ) |

Get an AttributeList from current read position.

## get_data() [6/13]

bool scim::TransactionReader::get_data | ( | Property & | property | ) |

Get a Property from current read position.

## get_data() [7/13]

bool scim::TransactionReader::get_data | ( | PropertyList & | properties | ) |

Get a PropertyList from current read position.

## get_data() [8/13]

bool scim::TransactionReader::get_data | ( | CommonLookupTable & | table | ) |

Get a CommonLookupTable from current read position.

## get_data() [9/13]

bool scim::TransactionReader::get_data | ( | std::vector< uint32 > & | vec | ) |

Get a std::vector<uint32> from current read position.

## get_data() [10/13]

bool scim::TransactionReader::get_data | ( | std::vector< String > & | vec | ) |

Get a std::vector<String> from current read position.

## get_data() [11/13]

bool scim::TransactionReader::get_data | ( | std::vector< WideString > & | vec | ) |

Get a std::vector<WideString> from current read position.

## get_data() [12/13]

bool scim::TransactionReader::get_data | ( | char ** | raw,
|  | size_t & | bufsize )

Get a raw buffer from current read position.

if raw == NULL then return the bufsize and skip this data. *raw should be deleted afterwards (do not use free!).

## get_data() [13/13]

bool scim::TransactionReader::get_data | ( | Transaction & | trans | ) |

Get a Transaction object from current read position.

## skip_data()

bool scim::TransactionReader::skip_data | ( |  | ) |

Skip one data from current read position.

## rewind()

void scim::TransactionReader::rewind | ( |  | ) |

Rewind the current read position, then the data can be read again.

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

- scim_transaction.h