Integer-based Key. More...
#include <rkeys.h>
Public Member Functions | |
RIntKey (void) | |
RIntKey (size_t id) | |
RIntKey (const RIntKey &key) | |
size_t | GetSize (void) const |
int | Compare (const char *data) const |
void | Read (R::RKeyValueFile< RIntKey > &file) |
void | Write (R::RKeyValueFile< RIntKey > &file) |
R::RString | GetKey (void) const |
RIntKey & | operator= (const RIntKey &src) |
Private Attributes | |
size_t | Id |
Detailed Description
Integer-based Key.
The RIntKey provides a representation for a key that is composed from a single integer. It can be used with RKeyValueFile to manage pairs of (key,value).
Constructor & Destructor Documentation
RIntKey | ( | void | ) |
Defaul construct.
RIntKey | ( | size_t | id | ) |
Constructor.
- Parameters
-
id Integer composing the key.
Member Function Documentation
size_t GetSize | ( | void | ) | const |
Get the size of a key. a size_t.
int Compare | ( | const char * | data | ) | const |
Compare the key with the one pointed by a given pointer.
- Parameters
-
Data containing the key to compare with.
- Returns
- +1, 0 or -1 depending if the current key is greater, identical or smaller than the key to compare with.
void Read | ( | R::RKeyValueFile< RIntKey > & | file | ) |
Read the key from a key-value file at the current position.
- Parameters
-
file File to read from.
void Write | ( | R::RKeyValueFile< RIntKey > & | file | ) |
Write the key in a key-value file at the current position.
- Parameters
-
file File to write in.
R::RString GetKey | ( | void | ) | const |
Get a string version of a key.
- Returns
- a RString.
Assignment operator.
- Parameters
-
key Source key.
- Returns
- the key assigned.
Field Documentation
|
private |
Integer representing the key.
- Returns