OOFILE  1.9
Public Member Functions | Protected Attributes | List of all members
dbTableAssigner Class Reference

Helper class for dbTable to easily assign field values; Provides idiom of People << "Andy" << "Dent" << "37"; instead of People.newRecord(); People.FirstName = "Andy"; People.LastName = "Dent"; People.Age = 37; People.saveRecord();. More...

#include <oof1.h>

Collaboration diagram for dbTableAssigner:
Collaboration graph
[legend]

Public Member Functions

 dbTableAssigner (dbTable *, const char *inFirstFieldValue)
 
dbTableAssigneroperator<< (const char *)
 
void setNextFieldString (const char *)
 Set a field to a value and increment iterator across fields. More...
 
 ~dbTableAssigner ()
 finish the steps of assigning fields by saving record More...
 

Protected Attributes

fieldNumT mNextFieldNum
 
dbTablemTable
 

Detailed Description

Helper class for dbTable to easily assign field values; Provides idiom of People << "Andy" << "Dent" << "37"; instead of People.newRecord(); People.FirstName = "Andy"; People.LastName = "Dent"; People.Age = 37; People.saveRecord();.

Definition at line 432 of file oof1.h.

Constructor & Destructor Documentation

dbTableAssigner::dbTableAssigner ( dbTable inTable,
const char *  inFirstFieldValue 
)

Definition at line 920 of file oof1.cpp.

References dbTable::isNewRecord(), mTable, dbTable::newRecord(), and setNextFieldString().

dbTableAssigner::~dbTableAssigner ( )

finish the steps of assigning fields by saving record

Definition at line 933 of file oof1.cpp.

References dbTable::isNewRecord(), mTable, and dbTable::saveRecord().

Member Function Documentation

dbTableAssigner & dbTableAssigner::operator<< ( const char *  inString)
inline

Definition at line 1757 of file oof1.h.

void dbTableAssigner::setNextFieldString ( const char *  inString)

Set a field to a value and increment iterator across fields.

Parameters
inStringcan be null pointer, meaning just skip a field.

Definition at line 945 of file oof1.cpp.

References dbTable::field(), mNextFieldNum, mTable, and dbField::setString().

Referenced by dbTableAssigner().

Member Data Documentation

fieldNumT dbTableAssigner::mNextFieldNum
protected

Definition at line 442 of file oof1.h.

Referenced by setNextFieldString().

dbTable* dbTableAssigner::mTable
protected

Definition at line 441 of file oof1.h.

Referenced by dbTableAssigner(), setNextFieldString(), and ~dbTableAssigner().


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