Class for the blob attributes of a Record.
More...
#include <GloBlobRecordAttribute.h>
|
| BlobRecordAttribute (ClassInfoAttribute *pType, const eut::Blob &rValue, const std::streampos &rFilePos) |
|
| BlobRecordAttribute (ClassInfoAttribute *pType, const std::streampos &rFilePos) |
|
virtual bool | dataIsFieldContent () const |
|
virtual int | getAttributeValueBlob (eut::Blob &rBlob) const |
|
virtual BaseRecordAttribute * | getCopy () |
|
virtual unsigned short | getDataFieldLength () const |
|
virtual std::string | getDataReference () const |
|
const std::string & | getFileName () const |
|
virtual int | getFormattedFieldContents (std::string &rsRetVal, DATA_REFERENCE_INFO &rRetValInfo, ObjID ObjID) |
|
virtual std::string | getValueAsDataString () const |
|
virtual std::string | getValueAsDisplayString () const |
|
virtual std::string | getValueAsStreamString () const |
|
virtual std::string | getValueAsString () const |
|
virtual void * | getValueAsVoidPointer () |
|
const eut::Blob & | getValueRef () const |
|
virtual void | initNew () |
|
virtual void | setDataReference (const std::string &rsDataReference) |
|
void | setDeterminedFileNameFromAttributeValue (ObjID ObjID) |
|
void | setFileName (const std::string &rsFileName) |
|
int | setValue (char *pData, std::size_t nDataSize, bool bCopy=true) |
|
void | setValue (const eut::Blob &rValue) |
|
virtual void | setValueFromVoid (void *pValue) |
|
virtual int | takeValue (const BaseRecordAttribute &rT) |
|
virtual int | updateDataReference (const std::string &rsDataPath, DATA_REFERENCE_INFO MethodInfo) |
|
|
bool | operator== (const BlobRecordAttribute &rT) const |
|
bool | operator!= (const BlobRecordAttribute &rT) const |
|
| BaseRecordAttribute (ClassInfoAttribute *pClassInfoAttribut, const std::streampos &rFilePos) |
|
virtual | ~BaseRecordAttribute () |
|
unsigned int | forget () |
|
AttributeID | getAttributeID () const |
|
ClassInfoAttribute * | getClassInfoAttribute () const |
|
std::string | getClassMemberName () const |
|
std::string | getClassName () const |
|
EnDataType | getDataType () const |
|
std::string | getFieldName () const |
|
int | getFieldPos () |
|
std::streampos | getFilePosition () const |
|
EnDataTypeGroup | getInfoType () |
|
unsigned int | getReferenceCount () const |
|
std::string | getTableFieldName () const |
|
std::string | getTableName () const |
|
ClassInfoAttribute::Type | getType () const |
|
std::string | getTypeAsCppString () const |
|
std::string | getTypeAsString () const |
|
std::string | getTypeInfo () const |
|
unsigned int | remember () |
|
void | setFilePosition (const std::streampos &rFilePos) |
|
virtual int | setValueFromObjectAttributeID (Persistent &rObject, const AttributeID &rAttributeID) |
|
bool | operator== (const BaseRecordAttribute &rT) const |
| Comparison operator, all attributes are compared.
|
|
bool | operator!= (const BaseRecordAttribute &rT) const |
| Comparison operator, all attributes are compared.
|
|
Class for the blob attributes of a Record.
Represents an attribute of the type 'eut::Blob' of a persistent object.
- Copyright
- © 2010 Helmut Jakoby
- Author
- Helmut Jakoby
◆ BlobRecordAttribute() [1/4]
glo::BlobRecordAttribute::BlobRecordAttribute |
( |
| ) |
|
|
protected |
The standard constructor is not available.
◆ ~BlobRecordAttribute()
virtual glo::BlobRecordAttribute::~BlobRecordAttribute |
( |
| ) |
|
|
protectedvirtual |
The destructor is not available. The object may only be removed from memory using forget().
◆ BlobRecordAttribute() [2/4]
glo::BlobRecordAttribute::BlobRecordAttribute |
( |
ClassInfoAttribute * | pType, |
|
|
const std::streampos & | rFilePos ) |
Constructor with parameter passing.
- Parameters
-
[in] | pType | A class information attribute is expected. |
[in] | rFilePos | The file position. |
- Exceptions
-
- Attention
- Since objects of these classes are only instantiated by internal objects like Record and TableReaderInterface, and they know what they are doing, a type check of the class information attribute is omitted!
◆ BlobRecordAttribute() [3/4]
glo::BlobRecordAttribute::BlobRecordAttribute |
( |
ClassInfoAttribute * | pType, |
|
|
const eut::Blob & | rValue, |
|
|
const std::streampos & | rFilePos ) |
Constructor with parameter passing.
- Parameters
-
[in] | pType | A class information attribute is expected. |
[in] | rValue | The value of the attribute. |
[in] | rFilePos | The file position. |
- Exceptions
-
- Attention
- Since objects of these classes are only instantiated by internal objects like Record and TableReaderInterface, and they know what they are doing, a type check of the class information attribute is omitted!
◆ BlobRecordAttribute() [4/4]
Copy constructor.
- Parameters
-
[in] | rT | The data is copied from this object. |
- See also
- getCopy()
◆ dataIsFieldContent()
virtual bool glo::BlobRecordAttribute::dataIsFieldContent |
( |
| ) |
const |
|
virtual |
Returns false, since attribute data of a blob is always stored outside the table. The file name of the file containing the blob data is stored in the table.
- Returns
- see above
Implements glo::BaseRecordAttribute.
◆ getAttributeValueBlob()
virtual int glo::BlobRecordAttribute::getAttributeValueBlob |
( |
eut::Blob & | rBlob | ) |
const |
|
virtual |
◆ getCopy()
Returns a copy of the object. Sometimes a copy of an attribute is needed, e.g. if a deep-copied record (with copied attributes) is needed.
- Returns
- The copy of this attribute
- Attention
- The supplied object must be removed from memory by the calling instance.
Implements glo::BaseRecordAttribute.
◆ getDataFieldLength()
virtual unsigned short glo::BlobRecordAttribute::getDataFieldLength |
( |
| ) |
const |
|
virtual |
Returns the record field length of the attribute value. In this case it is always the length of the file name of the file in which the blob is to be stored.
- Returns
- The field length.
- See also
- BLOB_TEXT_LENGTH
Implements glo::BaseRecordAttribute.
◆ getDataReference()
virtual std::string glo::BlobRecordAttribute::getDataReference |
( |
| ) |
const |
|
virtual |
Returns the file name in which the blob data is stored.
- Returns
- The existing file name if necessary. If empty, then there is probably none.
- Note
- The file name is delivered with complete path.
Reimplemented from glo::BaseRecordAttribute.
◆ getFileName()
const std::string & glo::BlobRecordAttribute::getFileName |
( |
| ) |
const |
Returns the name of the file in which the blob should be placed.
- Returns
- The file name.
- Note
- The file name is delivered without path and without file extension.
◆ getFormattedFieldContents()
virtual int glo::BlobRecordAttribute::getFormattedFieldContents |
( |
std::string & | rsRetVal, |
|
|
DATA_REFERENCE_INFO & | rRetValInfo, |
|
|
ObjID | ObjID ) |
|
virtual |
Provides the name of the external file with the attribute's data and a information whether it needs to be rewritten, kept or deleted if there is content to be saved. The name of the external file is also set in the m_sFileName attribute.
- Parameters
-
[in,out] | rsRetVal | The table field as it should be written. |
[in,out] | rRetValInfo | The information how to handle an external file. |
[in] | ObjID | If a file name has to be created, the file name is formed from this object ID. Usually this is the object ID of the object whose attribute value is requested. |
- Returns
- A return value < 0 indicates an error.
Reimplemented from glo::BaseRecordAttribute.
◆ getValueAsDataString()
virtual std::string glo::BlobRecordAttribute::getValueAsDataString |
( |
| ) |
const |
|
virtual |
◆ getValueAsDisplayString()
virtual std::string glo::BlobRecordAttribute::getValueAsDisplayString |
( |
| ) |
const |
|
virtual |
Returns the value as it can be displayed for the GUI.
- Returns
- The value for the display.
Implements glo::BaseRecordAttribute.
◆ getValueAsStreamString()
virtual std::string glo::BlobRecordAttribute::getValueAsStreamString |
( |
| ) |
const |
|
virtual |
◆ getValueAsString()
virtual std::string glo::BlobRecordAttribute::getValueAsString |
( |
| ) |
const |
|
virtual |
◆ getValueAsVoidPointer()
virtual void * glo::BlobRecordAttribute::getValueAsVoidPointer |
( |
| ) |
|
|
virtual |
◆ getValueRef()
const eut::Blob & glo::BlobRecordAttribute::getValueRef |
( |
| ) |
const |
Returns the reference to the value.
- Returns
- The value.
◆ initNew()
virtual void glo::BlobRecordAttribute::initNew |
( |
| ) |
|
|
virtual |
◆ operator!=()
Comparison operator, all attributes are compared.
- Parameters
-
[in] | rT | The object to be compared with this one. |
◆ operator=()
The assignment operator is not available.
◆ operator==()
Comparison operator, all attributes are compared.
- Parameters
-
[in] | rT | The object to be compared with this one. |
◆ setDataReference()
virtual void glo::BlobRecordAttribute::setDataReference |
( |
const std::string & | rsDataReference | ) |
|
|
virtual |
Sets the name of the file in which the blob is to be saved.
- Parameters
-
[in] | rsDataReference | The file name. |
- Note
- The file name is passed without path and without file extension.
Reimplemented from glo::BaseRecordAttribute.
◆ setDeterminedFileNameFromAttributeValue()
void glo::BlobRecordAttribute::setDeterminedFileNameFromAttributeValue |
( |
ObjID | ObjID | ) |
|
Sets the identified designation of the file in which the blob is to be accommodated if there is something to save.
- Parameters
-
[in] | ObjID | If a file name has to be created, the file name is formed from this object ID. Usually this is the object ID of the object whose attribute value is requested. |
◆ setFileName()
void glo::BlobRecordAttribute::setFileName |
( |
const std::string & | rsFileName | ) |
|
Sets the name of the file in which the blob should be placed.
- Parameters
-
[in] | rsFileName | The file name. |
- Note
- The file name is passed without path and without file extension.
◆ setValue() [1/2]
int glo::BlobRecordAttribute::setValue |
( |
char * | pData, |
|
|
std::size_t | nDataSize, |
|
|
bool | bCopy = true ) |
Sets the value of the attribute.
- Parameters
-
[in] | pData | A pointer to an allocated memory. |
[in] | nDataSize | The size of pData. |
[in] | bCopy | If false, pData is not copied, only the raw pointer is set. |
- Returns
- A return <0 indicates an error.
◆ setValue() [2/2]
void glo::BlobRecordAttribute::setValue |
( |
const eut::Blob & | rValue | ) |
|
Sets the value of the attribute.
- Parameters
-
◆ setValueFromVoid()
virtual void glo::BlobRecordAttribute::setValueFromVoid |
( |
void * | pValue | ) |
|
|
virtual |
Sets the value of the attribute. Is assigned via a static_cast.
- Parameters
-
[in] | pValue | The raw pointer to the value. |
Implements glo::BaseRecordAttribute.
◆ takeValue()
Adopts the value from transferred attribute, if possible. An attempt is made to cast the value in some way.
- Parameters
-
[in] | rT | The persistent attribute from which the values are to be taken. |
- Returns
- An error respectively warning message from subclasses will be delivered if the cast does not work.
Reimplemented from glo::BaseRecordAttribute.
◆ updateDataReference()
virtual int glo::BlobRecordAttribute::updateDataReference |
( |
const std::string & | rsDataPath, |
|
|
DATA_REFERENCE_INFO | MethodInfo ) |
|
virtual |
Deletes respectively writes an external file with the blob data.
- Parameters
-
[in] | rsDataPath | The full directory name where the data can be found. The data is always located in a subdirectory of the directory where the schema file is located (e.g. "C:/Path/Data/"). |
[in] | MethodInfo | The information how to handle an external file. |
- Returns
- A return value < 0 indicates an error.
Reimplemented from glo::BaseRecordAttribute.
◆ m_sFileName
std::string glo::BlobRecordAttribute::m_sFileName |
|
private |
A blob is always stored in a file with this name.
◆ m_Value
The value of the attribute.
The documentation for this class was generated from the following file: