Specialized version for std::string data type, trivial conversion to/from string. More...
#include <db_field.h>
Public Member Functions | |
DBField (Type type, DBClass *owner, std::string name, std::string table_name, bool write_permission) | |
DBField (DBClass *owner, const DBField< std::string > *other) | |
virtual bool | fromString (const std::string &str) |
Sets the value of this field from a text string. More... | |
virtual bool | toString (std::string &str) const |
Gets the value of this field as a text string. More... | |
Public Member Functions inherited from database_interface::DBFieldData< std::string > | |
const std::string & | data () const |
std::string & | data () |
DBFieldData (Type type, DBClass *owner, std::string name, std::string table_name, bool write_permission) | |
virtual bool | fromBinary (const char *, size_t) |
Sets the value of this field from a binary chunk of data. More... | |
const std::string & | get () const |
std::string & | get () |
virtual bool | toBinary (const char *&, size_t &) const |
Gets a pointer to the value of this field as a binary chunk of data. More... | |
Public Member Functions inherited from database_interface::DBFieldBase | |
DBFieldBase (Type type, DBClass *owner, std::string name, std::string table_name, bool write_permission) | |
std::string | getName () const |
DBClass * | getOwner () |
const DBClass * | getOwner () const |
bool | getReadFromDatabase () const |
std::string | getSequenceName () const |
std::string | getTableName () const |
Type | getType () const |
bool | getWritePermission () const |
bool | getWriteToDatabase () const |
void | setReadFromDatabase (bool sync) |
void | setReadWrite (bool sync) |
void | setSequenceName (std::string seq) |
void | setWriteToDatabase (bool sync) |
Additional Inherited Members | |
Public Types inherited from database_interface::DBFieldBase | |
enum | Type { TEXT, BINARY } |
Protected Member Functions inherited from database_interface::DBFieldData< std::string > | |
void | copy (const DBFieldData< std::string > *other) |
DBFieldData (DBClass *owner, const DBFieldData *other) | |
Copy constructor also copies the data itself. More... | |
Protected Member Functions inherited from database_interface::DBFieldBase | |
DBFieldBase (DBClass *owner, const DBFieldBase *other) | |
Copy constructor is protected, it should only be called by derived classes which also copy the data. More... | |
Protected Attributes inherited from database_interface::DBFieldData< std::string > | |
std::string | data_ |
Protected Attributes inherited from database_interface::DBFieldBase | |
std::string | name_ |
The name of the column that this field is stored in in the database. More... | |
DBClass * | owner_ |
The class that this field is part of. More... | |
bool | read_from_database_ |
Marks if this field should be read from the database when its owner is read. More... | |
std::string | sequence_name_ |
Optional: the name of a database sequence that is used as a default value for this field. More... | |
std::string | table_name_ |
The name of the table that this field is stored in the database. More... | |
Type | type_ |
The type of this field, either TEXT or BINARY. More... | |
bool | write_permission_ |
Marks if this field is allowed to be used to modify the database. More... | |
bool | write_to_database_ |
Marks if this field should be saved to the database when its owner is saved. More... | |
Specialized version for std::string data type, trivial conversion to/from string.
Definition at line 424 of file db_field.h.
|
inline |
Definition at line 428 of file db_field.h.
|
inline |
Definition at line 431 of file db_field.h.
|
inlinevirtual |
Sets the value of this field from a text string.
Reimplemented from database_interface::DBFieldData< std::string >.
Definition at line 436 of file db_field.h.
|
inlinevirtual |
Gets the value of this field as a text string.
Reimplemented from database_interface::DBFieldData< std::string >.
Definition at line 437 of file db_field.h.