Public Types | |
enum | Style { day = 0x01, hour = 0x02, minute = 0x04, second = 0x08, millisec = 0x10, time = hour | minute | second, day_time = day | time, mstime = time | millisec, day_mstime = day | mstime } |
Format styles. More... | |
Public Member Functions | |
CLongMsecTimeFormat (unsigned long style, bool showNonSignificative=false, const TString &timeSuffix=_T(""), const TString &daySuffix=_T("")) | |
Constructor. | |
~CLongMsecTimeFormat () | |
Virtual destructor. | |
virtual TString | FormatStl (long val, const CDataObject *pDO) const |
The function converts non-formatted value of long type to the formatted string. | |
virtual bool | ParseStl (const TString &str, long &val, const CDataObject *pDO) const |
The function converts the formatted string to the non-formatted value of long type. | |
virtual CString | FormatMfc (long val, const CDataObject *pDO) const |
The function converts non-formatted value of long type to the formatted MFC string. | |
virtual bool | ParseMfc (const CString &str, long &val, const CDataObject *pDO) const |
The function converts the formatted MFC string to the non-formatted long-type value. | |
virtual CFormat * | Clone () const |
Creates a deep copy of a format. | |
virtual bool | IsDate () const |
Indicates whether the format presents a date. | |
virtual unsigned long | GetStyle () const |
Gets a style of a format. | |
virtual void | Serialize (CSerializer &serializer) |
Serializes a format. | |
Static Public Member Functions | |
static int | GetSerializeVertion () |
Serialization version. |
The time is stored as long value. Therefore for signed values, the format will wrap interval around -24,86 .. 24.86 days and for unsigned values around to zero for 49.7 days.
Format examples: 1. CLongMsecTimeFormat(CLongMsecTimeFormat::time).FormatStl(1234567, 0); 2. CLongMsecTimeFormat(CLongMsecTimeFormat::day_time).FormatStl(1234567, 0); 3. CLongMsecTimeFormat(CLongMsecTimeFormat::mstime).FormatStl(1234567, 0); 4. CLongMsecTimeFormat(CLongMsecTimeFormat::day_mstime).FormatStl(1234567890, 0); 5. CLongMsecTimeFormat(CLongMsecTimeFormat::time, true).FormatStl(1234567, 0); 6. CLongMsecTimeFormat(CLongMsecTimeFormat::day_time, true).FormatStl(1234567, 0); 7. CLongMsecTimeFormat(CLongMsecTimeFormat::mstime, true).FormatStl(1234567, 0); 8. CLongMsecTimeFormat(CLongMsecTimeFormat::day_mstime, true).FormatStl(1234567890, 0); Output strings: 1. 20:34 2. 20:34 3. 20:34.567 4. 14 6:56:07.890 5. 00:20:34 6. 0 00:20:34 7. 00:20:34.567 8. 14 06:56:07.890
enum Style |
CLongMsecTimeFormat | ( | unsigned long | style, | |
bool | showNonSignificative = false , |
|||
const TString & | timeSuffix = _T("") , |
|||
const TString & | daySuffix = _T("") | |||
) |
Constructor.
[in] | style | Combination of CLongMsecTimeFormat::Style enumeration. |
[in] | showNonSignificative | Indicates whether it should show non-significant zeros |
[in] | timeSuffix | Suffix following time. |
[in] | daySuffix | Suffix following days. |
TString FormatStl | ( | long | val, | |
const CDataObject * | pDO | |||
) | const [virtual] |
The function converts non-formatted value of long type to the formatted string.
[in] | val | Non formatted value of long type. |
[in] | pDO | Pointer to CDataObject. This parameter is optional and may be zero. |
Reimplemented from CFormat.
bool ParseStl | ( | const TString & | str, | |
long & | val, | |||
const CDataObject * | pDO | |||
) | const [virtual] |
The function converts the formatted string to the non-formatted value of long type.
[in] | str | Formatted string. |
[in,out] | val | Value of long type that is a result of conversion. |
[in] | pDO | Pointer to CDataObject. This parameter is optional and may be zero. |
Reimplemented from CFormat.
CString FormatMfc | ( | long | val, | |
const CDataObject * | pDO | |||
) | const [virtual] |
The function converts non-formatted value of long type to the formatted MFC string.
[in] | val | Non-formatted MFC string to be formatted. |
[in] | pDO | Pointer to CDataObject. This parameter is optional and may be zero. |
Reimplemented from CFormat.
bool ParseMfc | ( | const CString & | str, | |
long & | val, | |||
const CDataObject * | pDO | |||
) | const [virtual] |
The function converts the formatted MFC string to the non-formatted long-type value.
[in] | str | MFC string to be formatted. |
[in,out] | val | A value of the long type that is a result of the parsing. |
[in] | pDO | Pointer to CDataObject. This parameter is optional and may be zero. |
Reimplemented from CFormat.
CFormat * Clone | ( | ) | const [virtual] |
bool IsDate | ( | ) | const [virtual] |
unsigned long GetStyle | ( | ) | const [virtual] |
void Serialize | ( | CSerializer & | serializer | ) | [virtual] |
Serializes a format.
[in] | serializer | Object, into which a format object is serialized. |
Reimplemented from CFormat.
Copyright Dapfor 2007-2009 | Generated on Wed Jul 7 03:24:43 2010 for MFCGrid by 1.5.5 |