Template class for easy creation of specific parser objects. More...
#include <parser.h>
Public Member Functions | |
RecordParser (StorageT &storage) | |
Constructor that references an externally managed storage object. | |
RecordParser (StorageT *storage=0) | |
Constructor that references a locally managed storage object. | |
virtual void | ParseRecord (const DBData &data, const IConverter *ic) |
Called to parse sub fields in the raw data packet. |
Template class for easy creation of specific parser objects.
This template takes the following template arguments:
Example LoadDatabase() call:
struct StoreContact { std::vector<Contact> &array; StoreContact(std::vector<Contact> &a) : array(a) {} void operator() (const Contact &c) { array.push_back(c); } };
Controller con(probeResult); con.OpenMode(Controller::Desktop); std::vector<Contact> contactList; StoreContact storage(contactList); RecordParser<Contact, StoreContact> parser(storage); con.LoadDatabase(con.GetDBID("Address Book"), parser);
Definition at line 249 of file parser.h.
Barry::RecordParser< RecordT, StorageT >::RecordParser | ( | StorageT & | storage | ) | [inline] |
Barry::RecordParser< RecordT, StorageT >::RecordParser | ( | StorageT * | storage = 0 |
) | [inline] |
virtual void Barry::RecordParser< RecordT, StorageT >::ParseRecord | ( | const DBData & | data, | |
const IConverter * | ic | |||
) | [inline, virtual] |
Called to parse sub fields in the raw data packet.
Implements Barry::Parser.