Location:
cdbtemp.h
Link against: commdb.lib
CCommsDbTemplateRecord
Supported from 5.0
The view on a template record of a specific table.
The view contains only
the template record and therefore, unlike the more general
CCommsDbTableView
class, does not contain any navigation
functions.
This class does, however, contain the necessary member functions for reading and writing to columns.
|
Defined in CCommsDbTemplateRecord
:
CancelModifications()
, Delete()
, GetTableName()
, Modify()
, NewL()
, ReadBoolL()
, ReadColumnLengthL()
, ReadLongTextLC()
, ReadTextL()
, ReadTypeAttribL()
, ReadUintL()
, StoreModifications()
, TemplateRecordExists()
, WriteBoolL()
, WriteLongTextL()
, WriteTextL()
, WriteUintL()
, ~CCommsDbTemplateRecord()
Inherited from CBase
:
operator new()
static CCommsDbTemplateRecord* NewL(CCommsDatabase* aDb,const TDesC& aTableName);
Allocates and constructs a view, which includes only the template record, on the table whose name is defined in the specified descriptor and which is in the specified communications database.
The view is restricted to the single template record in the table.
The communications database, pointed to by aDb
should already have been opened.
|
|
|
~CCommsDbTemplateRecord();
Frees all resources owned by this object, prior to its destruction. Specifically, it closes the view.
TBool TemplateRecordExists();
Tests whether a template record exists in this table.
|
TInt Modify();
Prepares to update the template record, if it exists. If the template record does not exist, it is created.
The function must be called before writing to any column.
Once all changes to the template record are complete, a call must be
made to either StoreModifications()
or
CancelModifications()
as appropriate.
Notes:
This function raises a CommsDbServer 1 or a CommsDbServer 2 panic
if a previous call to Modify()
has already been made.
This function must be called before any attempt is made to write to a column otherwise subsequent write operations raise a CommsDbServer 12 panic.
Once this function has completed successfully, no attempt can be
made to read from a column until either StoreModifications()
or
CancelModifications()
has been called to complete the record
insertion operation, otherwise the read operations raise a CommsDbServer 10
panic.
|
TInt Delete();
Deletes the template record.
Note:
This function raises a CommsDbServer 3 panic if a previous call to
Modify()
has been made.
|
TInt StoreModifications();
Confirms changes made to the template record which were started by a call
to Modify()
.
Note:
A call to Modify()
must have previously been made
otherwise the function raises a CommsDbServer 4 panic.
|
void CancelModifications();
Supported from 6.0
Abandons changes made to the template record which were started by a call
to Modify()
.
Note:
A call to Modify()
must have previously been made otherwise
the function raises a CommsDbServer 5 panic.
TInt CancelModifications();
Withdrawn in 6.0
Abandons changes made to the template record which were started by a call
to Modify()
.
Note:
A call to Modify()
must have previously been made otherwise
the function raises a CommsDbServer 5 panic.
|
void ReadTypeAttribL(const TDesC& aColumn, TDbColType& aColType, TUint32& aAttrib);
Gets the type and the attributes of a specific column within the template
record and puts them into a reference to an object and a reference to an
unsigned integer respectively. The column is identified by the name supplied in
the descriptor aColumn
.
The column type is described by the TDbColType
enumerator
defined in d32dbms.h.
The column attributes are one or more of the
valuesTDbCol::ENotNull
andTDbCol::EAutoIncrement
defined in d32dbms.h.
Note:
This function must not be called if any of the operations involved in
changing the template record are still outstanding, otherwise the function
raises a CommsDbServer 10 panic. For example, the panic is raised if this
function is called between calls
toModify()
andStoreModifications()
.
|
|
void ReadUintL(const TDesC& aColumn, TUint32& aValue);
Reads an unsigned integer value located in a specific column within the
template record and copies it into the specified unsigned integer. The column
is identified by the name supplied in the
descriptoraColumn
.
Notes:
This read operation must not occur if any of the operations involved in
changing the template record are still outstanding, otherwise the function
raises a CommsDbServer 10 panic. For example, the panic is raised if this
function is called between calls
toModify()
andStoreModifications()
.
The CommsDbServer 10 panic is also raised if this function is called after the view has been closed.
|
|
void ReadBoolL(const TDesC& aColumn, TBool& aValue);
Reads a boolean value located in a specific column within the template
record and copies it into the specified descriptor. The column is identified by
the name supplied in the descriptor aColumn
.
Notes:
This read operation must not occur if any of the operations involved in
changing the template record are still outstanding, otherwise the function
raises a CommsDbServer 10 panic. For example, the panic is raised if this
function is called between calls
toModify()
andStoreModifications()
.
The CommsDbServer 10 panic is also raised if this function is called after the view has been closed.
|
|
void ReadTextL(const TDesC& aColumn, TDes8& aValue);
Reads narrow (ASCII) text located in a specific column within the
template record and copies it to the specified 8 bit modifiable descriptor. The
column is identified by the name supplied in the
descriptoraColumn
.
The maximum length of text expected by this function is the value of the
constant KCommsDbSvrMaxColumnNameLength
defined in cdblen.h.
The maximum length of aValue
supplied by the caller can,
therefore, be the same.
Notes:
This read operation must not occur if any of the operations involved in
changing the template record are still outstanding, otherwise the function
raises a CommsDbServer 10 panic. For example, the panic is raised if this
function is called between calls
toModify()
andStoreModifications()
.
The CommsDbServer 10 panic is also raised if this function is called after the view has been closed.
|
|
void ReadTextL(const TDesC& aColumn, TDes16& aValue);
Reads wide (UNICODE) text located in a specific column within the
template record and copies it to the specified 16 bit modifiable descriptor.
The column is identified by the name supplied in the
descriptoraColumn
.
The maximum length of text expected by this function is the value of the
constant KCommsDbSvrMaxColumnNameLength
defined in cdblen.h.
The maximum length of aValue
supplied by the caller can,
therefore, be the same.
Notes:
This read operation must not occur if any of the operations involved in
changing the template record are still outstanding, otherwise the function
raises a CommsDbServer 10 panic. For example, the panic is raised if this
function is called between calls
toModify()
andStoreModifications()
.
The CommsDbServer 10 panic is also raised if this function is called after the view has been closed.
|
|
void ReadColumnLength(const TDesC& aColumn, TInt& aLength);
Gets the length of a specific column within the template record and
copies it to an integer passed by the caller. The column is identified by the
name supplied in the descriptor aColumn
.
Notes:
This read operation must not occur if any of the operations involved in
changing a template record are still outstanding, otherwise the function raises
a CommsDbServer 10 panic. For example, the panic is raised if this function is
called between calls
toModify()
andStoreModifications()
.
The CommsDbServer 10 panic is also raised if this function is called after the view has been closed.
|
|
HBufC* ReadLongTextLC(const TDesC& aColumn);
Reads the long text located in a specific column within the template
record and copies this text to a heap descriptor. The heap descriptor is
allocated and its pointer returned by this function. The column is identified
by the name supplied in the descriptor aColumn
.
While the text in columns retrieved by
theReadTextL()
functions is limited in length, there is no
restriction on the length of long text.
Notes:
This read operation must not occur if any of the operations involved in
changing a record are still outstanding, otherwise the function raises a
CommsDbServer 10 panic. For example, the panic is raised if this function is
called between calls
toModify()
andStoreModifications()
.
The CommsDbServer 10 panic is also raised if this function is called after the view has been closed.
|
|
|
void WriteUintL(const TDesC& aColumn, const TUint32& aValue);
Writes a specified unsigned integer value to a specific column within the
template record. The column is identified by the name supplied in the
descriptor aColumn
.
An earlier call to Modify()
must have been made before
calling this function otherwise the function raises a CommsDbServer 12
panic.
The CommsDbServer 12 panic is also raised if this function is called after the view has been closed.
Note:
The column being changed must not be the Id column (symbolic
nameCOMMDB_ID
)otherwise the function raises a CommsDbServer 13
panic.
|
|
void WriteBoolL(const TDesC& aColumn, const TBool& aValue);
Writes a specified boolean value to a specific column within the template
record. The column is identified by the name supplied in the
descriptoraColumn
.
An earlier call to Modify()
must have been made before
calling this function otherwise the function raises a CommsDbServer 12
panic.
The CommsDbServer 12 panic is also raised if this function is called after the view has been closed.
|
|
void WriteTextL(const TDesC& aColumn, const TDesC8& aValue);
Writes the narrow (ASCII) text from the specified 8 bit descriptor to a
specific column within the template record. The column is identified by the
name supplied in the descriptor aColumn
.
An earlier call to Modify()
must have been made before
calling this function otherwise the function raises a CommsDbServer 12
panic.
|
|
void WriteTextL(const TDesC& aColumn, const TDesC16& aValue);
Writes the wide (Unicode) text from the specified 16 bit descriptor to a
specific column within the template record. The column is identified by the
name supplied in the descriptor aColumn
.
An earlier call to Modify()
must have been made before
calling this function otherwise the function raises a CommsDbServer 12
panic.
The CommsDbServer 12 panic is also raised if this function is called after the view has been closed.
|
|
void WriteLongTextL(const TDesC& aColumn, const TDesC& aValue);
Writes the long text from a specified descriptor to a specific column
within the template record. The column is identified by the name supplied in
the descriptor aColumn
.
An earlier call to Modify()
must have been made before
calling this function otherwise the function raises a CommsDbServer 12
panic.
The CommsDbServer 12 panic is also raised if this function is called after the view has been closed.
While the text written by WriteTextL()
functions is limited
in length, there is no restriction on the length of long text.
|
|
void GetTableName(TDes& aTableName) const;
Gets the name of the table associated with this view and copy it into the descriptor supplied by the caller.
|