#include <fldbltin.h>
Link against: field.lib
class CDateTimeField : public CTextField, public CTextField |
Protected Attributes | |
---|---|
TBuf< 64 > | iFormatString |
Public Member Functions | |
---|---|
CDateTimeField() | |
virtual IMPORT_C void | ExternalizeL(RWriteStream &) |
IMPORT_C const TDesC & | FormatString() |
virtual IMPORT_C void | InternalizeL(RReadStream &) |
IMPORT_C void | SetFormat(const TDesC &) |
virtual IMPORT_C TUid | Type() |
virtual IMPORT_C TInt | Value(TPtr &) |
A date/time field.
This may contain any or all components of the date and time, and can be formatted in a variety of ways. It stores a format string, which is used by the Value() function to format the current date/time. For information on date/time formatting, see TTime::FormatL().
TBuf< 64 > | iFormatString | [protected] |
IMPORT_C | CDateTimeField | ( | ) |
The default C++ constructor initialises the object's date/time format string to DMY%/0%1%/1%2%/2%3%/3. This produces fields in the format "31/05/2000" (with no time component, and using the current locale's date separators).
IMPORT_C void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [virtual] |
Reimplemented from CTextField::ExternalizeL(RWriteStream &)const
Externalises the format string to a write stream. The presence of this function means that the standard templated operator<<() (defined in s32strm.h) is available to externalise objects of this class.
Parameters | |
---|---|
aStream | Stream to which the format string should be externalised. |
IMPORT_C const TDesC & | FormatString | ( | ) | const |
Gets the field's date/time format string.
IMPORT_C void | InternalizeL | ( | RReadStream & | aStream | ) | [virtual] |
Reimplemented from CTextField::InternalizeL(RReadStream &)
Internalises the format string from a read stream. The presence of this function means that the standard templated operator>>() (defined in s32strm.h) is available to internalise objects of this class.
Parameters | |
---|---|
aStream | Stream from which the format string should be internalised. |
IMPORT_C void | SetFormat | ( | const TDesC & | aFormat | ) |
Sets the date/time format string. For information on the format string, see the documentation of TTime::FormatL().
Parameters | |
---|---|
aFormat | The new date/time format string. |
IMPORT_C TUid | Type | ( | ) | const [virtual] |
Reimplemented from CTextField::Type()const
Gets the field's type UID.
Reimplemented from CTextField::Value(TPtr &)
Gets the current local date/time, then formats it according to the field's format string. aValueText is set to the formatted date/time string if the buffer is large enough to contain it. If not, the function returns the length which is required to contain the formatted date/time string.
Parameters | |
---|---|
aValueText | Descriptor which on return contains the current date/time, formatted according to the format string. |