EMA C++ Edition
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Types | Public Member Functions
thomsonreuters::ema::access::DateTimeStringFormat Class Reference

DateTimeStringFormat is an interface to string conversion methods for OmmDate, OmmTime & OmmDateTime. More...

Public Types

enum  DateTimeStringFormatTypes {
  STR_DATETIME_ISO8601 = 1,
  STR_DATETIME_RSSL = 2
}
 

Public Member Functions

const EmaStringdateAsString (OmmDate &date)
 
const EmaStringdateTimeAsString (OmmDateTime &dateTime)
 
 DateTimeStringFormat ()
 
void dateTimeStringFormatType (DateTimeStringFormatTypes format)
 
DateTimeStringFormatTypes getDateTimeStringFormatType ()
 
const EmaStringtimeAsString (OmmTime &time)
 

Detailed Description

Remarks
DateTimeStringFormat is single threaded.
If an application accesses a single object of DateTimeStringFormat via multiple threads,
it needs to implement its own locking mechanism.
See Also
Data, OmmDate, OmmTime, OmmDateTime

Definition at line 37 of file DateTimeStringFormat.h.

Member Enumeration Documentation

An enumeration representing item data state.

Enumerator
STR_DATETIME_ISO8601 

Indicates Date/Time/DateTime to string output in ISO8601's dateTime format: "YYYY-MM-DDThour:minute:second.nnnnnnnnn" (e.g., 2010-11-30T15:24:54.627529436).

STR_DATETIME_RSSL 

Indicates Date/Time/DateTime to string output in to string output in the default format: "DD MON YYYY hour:minute:second:milli:micro:nano" (e.g., 30 NOV 2010 15:24:54:627:529:436).

Definition at line 43 of file DateTimeStringFormat.h.

Constructor & Destructor Documentation

thomsonreuters::ema::access::DateTimeStringFormat::DateTimeStringFormat ( )
inline

Definition at line 51 of file DateTimeStringFormat.h.

Member Function Documentation

const EmaString& thomsonreuters::ema::access::DateTimeStringFormat::dateAsString ( OmmDate date)

Returns the OmmDate value as a string in a specified format.

Parameters
[in]OmmDatethat needs to be converted to string.
Returns
string representation of this object OmmDate in the specified format
const EmaString& thomsonreuters::ema::access::DateTimeStringFormat::dateTimeAsString ( OmmDateTime dateTime)

Returns the OmmDateTime value as a string in a specified format.

Parameters
[in]OmmDateTimethat needs to be converted to string.
Returns
string representation of this object OmmDateTime in the specified format
void thomsonreuters::ema::access::DateTimeStringFormat::dateTimeStringFormatType ( DateTimeStringFormatTypes  format)
Specifies DateTimeStringFormatType.
Exceptions
OmmOutOfRangeExceptionif format is not any of the enumerations of DateTimeStringFormatTypes.
Parameters
[in]DateTimeStringFormatTypesspecifies the format of the string output of Date/Time/DateTime
Returns
format of the output string.
DateTimeStringFormatTypes thomsonreuters::ema::access::DateTimeStringFormat::getDateTimeStringFormatType ( )

Returns DateTimeStringFormatTypes.

Returns
value of DateTimeStringFormatTypes
const EmaString& thomsonreuters::ema::access::DateTimeStringFormat::timeAsString ( OmmTime time)

Returns the OmmTime value as a string in a specified format.

Parameters
[in]OmmTimethat needs to be converted to string.
Returns
string representation of this object OmmTime in the specified format