SQL Relay C++ API
Public Member Functions | List of all members
sqlrrowdictionary Class Reference

#include <sqlrcollections.h>

Inherits dictionarycollection< const char *, const char * >.

Public Member Functions

 sqlrrowdictionary ()
 
 sqlrrowdictionary (sqlrcursor *cursor)
 
 sqlrrowdictionary (sqlrcursor *cursor, uint64_t row)
 
 ~sqlrrowdictionary ()
 
void setCursor (sqlrcursor *cursor)
 
void setRow (uint64_t row)
 
bool isReadOnly ()
 
bool getValue (const char *key, const char **value)
 
const char * getValue (const char *key)
 
bool getKey (const char *key, const char **k)
 
const char * getKey (const char *key)
 
linkedlist< const char * > * getKeys ()
 
uint64_t getCount ()
 

Detailed Description

The sqlrrowdictionary class is a read-only implementation of the rudiments dictionarycollection<const char *, const char *> class.

After setting the cursor and row, it provides read-only access to the values of a single row in the result set, by column name.

The instance can be passed into any method that operates on a read-only rudiments dictionarycollection<const char *, const char *>, or otherwise used in the same manner that a read-only rudiments dictionarycollection<const char *, const char *> would be.

Constructor & Destructor Documentation

◆ sqlrrowdictionary() [1/3]

sqlrrowdictionary::sqlrrowdictionary ( )

Creates an instance of the sqlrrowdictionary class.

◆ sqlrrowdictionary() [2/3]

sqlrrowdictionary::sqlrrowdictionary ( sqlrcursor * cursor)

Creates an instance of the sqlrrowdictionary class and sets the cursor used by the instance to "cursor".

◆ sqlrrowdictionary() [3/3]

sqlrrowdictionary::sqlrrowdictionary ( sqlrcursor * cursor,
uint64_t row )

Creates an instance of the sqlrrowdictionary class. Sets the cursor used by the instance to "cursor" and the row that the instance returns fields from to "row".

◆ ~sqlrrowdictionary()

sqlrrowdictionary::~sqlrrowdictionary ( )

Deletes this instance of the sqlrrowdictionary class.

Member Function Documentation

◆ getCount()

uint64_t sqlrrowdictionary::getCount ( )

Returns the number of key/value (column name/field) pairs in the dictionary.

◆ getKey() [1/2]

const char * sqlrrowdictionary::getKey ( const char * key)

Returns the key (column name) associated with "key" (also column name) or NULL if "key" (also the column name) wasn't found (was an invalid column name). Note that there is no way to distinguish between failure to find "key" and a valid key (column name) of NULL associated with "key" (also column name).

◆ getKey() [2/2]

bool sqlrrowdictionary::getKey ( const char * key,
const char ** k )

Sets "k" to the key (column name) associated with "key" (also the column name). Returns true on success or false if "key" wasn't found (invalid column name).

◆ getKeys()

linkedlist< const char * > * sqlrrowdictionary::getKeys ( )

Returns a list of the keys (column names) in the dictionary.

◆ getValue() [1/2]

const char * sqlrrowdictionary::getValue ( const char * key)

Returns the value (field) associated with "key" (column name) or NULL if "key" wasn't found (was an invalid column name). Note that there is no way to distinguish between failure to find "key" and a valid value of NULL associated with "key".

◆ getValue() [2/2]

bool sqlrrowdictionary::getValue ( const char * key,
const char ** value )

Sets "value" to the value (field) associated with "key" (column name).

Returns true on success or false if "key" wasn't found.

◆ isReadOnly()

bool sqlrrowdictionary::isReadOnly ( )

Returns true.

◆ setCursor()

void sqlrrowdictionary::setCursor ( sqlrcursor * cursor)

Sets the cursor used by this instance to "cursor".

◆ setRow()

void sqlrrowdictionary::setRow ( uint64_t row)

Sets the row that this instance returns fields from to "row".