Class HashDb

Index Home MAE > MAE Architecture > MAE Data Types > Class Index > Class HashDb

Public Methods
HashDb(filename)
bool valid()
inline int size() const
bool create(fields)
int saveCSV()
int loadCSV()
inline void setChangeFlag()
inline bool changed() const
int getFieldId(field)
HashArray getFieldNames()
HashArray rowIndicesToFields(row) const
int findMatch(criteria, result, rows, multiples, exact) const
HashArray findRecord(field1, value1, field2, value2, field3, value3) const
HashArray findExactRecord(field1, value1, field2, value2, field3, value3) const
HashArrayArray findRecords(field1, value1, field2, value2, field3, value3) const
HashArrayArray findExactRecords(field1, value1, field2, value2, field3, value3) const
HashArray findRecordById(id) const
int insertRecord(values)
void deleteRecord(id)
int push(values)
HashArray pop()
inline HashArray get(id) const
const string& get(id, field) const
int getInt(id, field) const
bool getBool(id, field) const
HashDb& setFields(id, fields)
HashDb& setField(id, field, value)
HashDb& setFieldInt(id, field, value)
HashDb& setFieldBool(id, field, value)
HashDb& setFields(fields)
inline const HashArray& getFields() const
Private Properties
Private Methods
int internalFind(multiples, exact, result, rows, field1, value1, field2, value2, field3, value3) const
int nextId()

#include <HashDb.h >

Super class: HashArrayArray

Public Methods

HashDb(filename)

const string& filename


bool valid()

inline int size() const

bool create(fields)

HashArray& fields


int saveCSV()

int loadCSV()

inline void setChangeFlag()

inline bool changed() const

int getFieldId(field)

string field


HashArray getFieldNames()

HashArray rowIndicesToFields(row) const

HashArray& row


int findMatch(criteria, result, rows, multiples, exact) const

HashArray& criteria

HashArray& result

HashArrayArray& rows

bool multiples

Default value: false

bool exact

Default value: true


HashArray findRecord(field1, value1, field2, value2, field3, value3) const

const string& field1

const string& value1

const string& field2

Default value: ""

const string& value2

Default value: ""

const string& field3

Default value: ""

const string& value3

Default value: ""


HashArray findExactRecord(field1, value1, field2, value2, field3, value3) const

const string& field1

const string& value1

const string& field2

Default value: ""

const string& value2

Default value: ""

const string& field3

Default value: ""

const string& value3

Default value: ""


HashArrayArray findRecords(field1, value1, field2, value2, field3, value3) const

const string& field1

const string& value1

const string& field2

Default value: ""

const string& value2

Default value: ""

const string& field3

Default value: ""

const string& value3

Default value: ""


HashArrayArray findExactRecords(field1, value1, field2, value2, field3, value3) const

const string& field1

const string& value1

const string& field2

Default value: ""

const string& value2

Default value: ""

const string& field3

Default value: ""

const string& value3

Default value: ""


HashArray findRecordById(id) const

int id


int insertRecord(values)

HashArray& values


void deleteRecord(id)

int id


int push(values)

HashArray& values


HashArray pop()

inline HashArray get(id) const

int id


const string& get(id, field) const

int id

const string& field


int getInt(id, field) const

int id

const string& field


bool getBool(id, field) const

int id

const string& field


HashDb& setFields(id, fields)

int id

const HashArray& fields


HashDb& setField(id, field, value)

int id

const string& field

const string& value


HashDb& setFieldInt(id, field, value)

int id

const string& field

int value


HashDb& setFieldBool(id, field, value)

int id

const string& field

bool value


HashDb& setFields(fields)

const HashArray& fields


inline const HashArray& getFields() const

Private Properties

string csvfilename

HashArray fields

int nextIdvalue

bool needsSave

bool dbLoaded


Private Methods

int internalFind(multiples, exact, result, rows, field1, value1, field2, value2, field3, value3) const

bool multiples

bool exact

HashArray& result

HashArrayArray& rows

const string& field1

const string& value1

const string& field2

Default value: ""

const string& value2

Default value: ""

const string& field3

Default value: ""

const string& value3

Default value: ""


int nextId()