LibreOffice Module sc (master)  1
Public Member Functions | Private Attributes | List of all members
XclPCItem Class Reference

Represents a data item of any type in a pivot cache. More...

#include <xlpivot.hxx>

Inheritance diagram for XclPCItem:
[legend]
Collaboration diagram for XclPCItem:
[legend]

Public Member Functions

 XclPCItem ()
 
virtual ~XclPCItem ()
 
 XclPCItem (XclPCItem const &)=default
 
 XclPCItem (XclPCItem &&)=default
 
XclPCItemoperator= (XclPCItem const &)=default
 
XclPCItemoperator= (XclPCItem &&)=default
 
void SetEmpty ()
 Sets the item to 'empty' type. More...
 
void SetText (const OUString &rText)
 Sets the item to 'text' type and adds the passed text. More...
 
void SetDouble (double fValue, const OUString &rText=OUString())
 Sets the item to 'double' type and adds the passed value. More...
 
void SetDateTime (const DateTime &rDateTime, const OUString &rText=OUString())
 Sets the item to 'date/time' type and adds the passed date. More...
 
void SetInteger (sal_Int16 nValue)
 Sets the item to 'integer' type and adds the passed value. More...
 
void SetError (sal_uInt16 nError)
 Sets the item to 'error' type and adds the passed Excel error code. More...
 
void SetBool (bool bValue, const OUString &rText=OUString())
 Sets the item to 'boolean' type and adds the passed Boolean value. More...
 
const OUString & ConvertToText () const
 Returns the text representation of the item. More...
 
bool IsEqual (const XclPCItem &rItem) const
 Returns true, if the passed term equals this item. More...
 
bool IsEmpty () const
 Returns true, if the item type is 'empty'. More...
 
const OUString * GetText () const
 Returns pointer to text, if the item type is 'text', otherwise 0. More...
 
const double * GetDouble () const
 Returns pointer to value, if the item type is 'double', otherwise 0. More...
 
const DateTimeGetDateTime () const
 Returns pointer to date, if the item type is 'date/time', otherwise 0. More...
 
const sal_Int16 * GetInteger () const
 Returns pointer to integer, if the item type is 'integer', otherwise 0. More...
 
const sal_uInt16 * GetError () const
 Returns pointer to error code, if the item type is 'error', otherwise 0. More...
 
const bool * GetBool () const
 Returns pointer to Boolean value, if the item type is 'boolean', otherwise 0. More...
 
XclPCItemType GetType () const
 Returns the type of the item. More...
 

Private Attributes

XclPCItemType meType
 
OUString maText
 Type of the item. More...
 
DateTime maDateTime
 Text representation of the item. More...
 
union {
   double   mfValue
 
   sal_Int16   mnValue
 Value of a floating-point item. More...
 
   sal_uInt16   mnError
 Value of an integer item. More...
 
   bool   mbValue
 Error code of an error item. More...
 
}; 
 Value of a date/time item. More...
 

Detailed Description

Represents a data item of any type in a pivot cache.

Supposed as base class for import and export.

Definition at line 367 of file xlpivot.hxx.

Constructor & Destructor Documentation

XclPCItem::XclPCItem ( )
explicit

Definition at line 45 of file xlpivot.cxx.

References EMPTY, and meType.

XclPCItem::~XclPCItem ( )
virtual

Definition at line 51 of file xlpivot.cxx.

XclPCItem::XclPCItem ( XclPCItem const &  )
default
XclPCItem::XclPCItem ( XclPCItem &&  )
default

Member Function Documentation

const OUString& XclPCItem::ConvertToText ( ) const
inline

Returns the text representation of the item.

Definition at line 394 of file xlpivot.hxx.

References maText.

Referenced by XclExpPCField::GetItemIndex(), and XclExpPTItem::GetItemName().

const bool * XclPCItem::GetBool ( ) const

Returns pointer to Boolean value, if the item type is 'boolean', otherwise 0.

Definition at line 160 of file xlpivot.cxx.

References EXC_PCITEM_BOOL, mbValue, and meType.

Referenced by XclExpPCItem::EqualsBool(), and XclExpPCItem::WriteBody().

const DateTime * XclPCItem::GetDateTime ( ) const

Returns pointer to date, if the item type is 'date/time', otherwise 0.

Definition at line 145 of file xlpivot.cxx.

References EXC_PCITEM_DATETIME, maDateTime, and meType.

Referenced by XclExpPCItem::EqualsDateTime(), and XclExpPCItem::WriteBody().

const double * XclPCItem::GetDouble ( ) const

Returns pointer to value, if the item type is 'double', otherwise 0.

Definition at line 140 of file xlpivot.cxx.

References EXC_PCITEM_DOUBLE, meType, and mfValue.

Referenced by XclExpPCItem::EqualsDouble(), and XclExpPCItem::WriteBody().

const sal_uInt16 * XclPCItem::GetError ( ) const

Returns pointer to error code, if the item type is 'error', otherwise 0.

Definition at line 155 of file xlpivot.cxx.

References EXC_PCITEM_ERROR, meType, and mnError.

const sal_Int16 * XclPCItem::GetInteger ( ) const

Returns pointer to integer, if the item type is 'integer', otherwise 0.

Definition at line 150 of file xlpivot.cxx.

References EXC_PCITEM_INTEGER, meType, and mnValue.

Referenced by XclExpPCItem::WriteBody().

const OUString * XclPCItem::GetText ( ) const

Returns pointer to text, if the item type is 'text', otherwise 0.

Definition at line 135 of file xlpivot.cxx.

References EXC_PCITEM_ERROR, EXC_PCITEM_TEXT, maText, and meType.

Referenced by XclExpPCItem::EqualsText(), XclImpPTItem::GetItemName(), and XclExpPCItem::WriteBody().

XclPCItemType XclPCItem::GetType ( ) const

Returns the type of the item.

Definition at line 165 of file xlpivot.cxx.

References meType.

bool XclPCItem::IsEmpty ( ) const

Returns true, if the item type is 'empty'.

Definition at line 130 of file xlpivot.cxx.

References EXC_PCITEM_EMPTY, and meType.

Referenced by XclExpPCItem::EqualsText(), and XclExpPCItem::WriteBody().

bool XclPCItem::IsEqual ( const XclPCItem rItem) const

Returns true, if the passed term equals this item.

Definition at line 113 of file xlpivot.cxx.

References EXC_PCITEM_BOOL, EXC_PCITEM_DATETIME, EXC_PCITEM_DOUBLE, EXC_PCITEM_EMPTY, EXC_PCITEM_ERROR, EXC_PCITEM_INTEGER, EXC_PCITEM_INVALID, EXC_PCITEM_TEXT, maDateTime, maText, mbValue, meType, mfValue, mnError, and mnValue.

Referenced by operator==().

XclPCItem& XclPCItem::operator= ( XclPCItem const &  )
default
XclPCItem& XclPCItem::operator= ( XclPCItem &&  )
default
void XclPCItem::SetBool ( bool  bValue,
const OUString &  rText = OUString() 
)

Sets the item to 'boolean' type and adds the passed Boolean value.

Definition at line 106 of file xlpivot.cxx.

References EXC_PCITEM_BOOL, maText, mbValue, and meType.

Referenced by XclExpPCItem::XclExpPCItem().

void XclPCItem::SetDateTime ( const DateTime rDateTime,
const OUString &  rText = OUString() 
)

Sets the item to 'date/time' type and adds the passed date.

Definition at line 74 of file xlpivot.cxx.

References EXC_PCITEM_DATETIME, maDateTime, maText, and meType.

Referenced by XclExpPCItem::XclExpPCItem().

void XclPCItem::SetDouble ( double  fValue,
const OUString &  rText = OUString() 
)

Sets the item to 'double' type and adds the passed value.

Definition at line 67 of file xlpivot.cxx.

References EXC_PCITEM_DOUBLE, maText, meType, and mfValue.

Referenced by XclExpPCItem::XclExpPCItem().

void XclPCItem::SetEmpty ( )

Sets the item to 'empty' type.

Definition at line 55 of file xlpivot.cxx.

References EXC_PCITEM_EMPTY, maText, and meType.

Referenced by XclExpPCItem::XclExpPCItem().

void XclPCItem::SetError ( sal_uInt16  nError)

Sets the item to 'error' type and adds the passed Excel error code.

Definition at line 88 of file xlpivot.cxx.

References EXC_PCITEM_ERROR, maText, meType, and mnError.

void XclPCItem::SetInteger ( sal_Int16  nValue)

Sets the item to 'integer' type and adds the passed value.

Definition at line 81 of file xlpivot.cxx.

References EXC_PCITEM_INTEGER, maText, meType, and mnValue.

Referenced by XclExpPCItem::XclExpPCItem().

void XclPCItem::SetText ( const OUString &  rText)

Sets the item to 'text' type and adds the passed text.

Definition at line 61 of file xlpivot.cxx.

References EXC_PCITEM_TEXT, maText, and meType.

Referenced by XclExpPCItem::XclExpPCItem().

Member Data Documentation

union { ... }

Value of a date/time item.

DateTime XclPCItem::maDateTime
private

Text representation of the item.

Definition at line 420 of file xlpivot.hxx.

Referenced by GetDateTime(), IsEqual(), and SetDateTime().

OUString XclPCItem::maText
private

Type of the item.

Definition at line 419 of file xlpivot.hxx.

Referenced by ConvertToText(), GetText(), IsEqual(), SetBool(), SetDateTime(), SetDouble(), SetEmpty(), SetError(), SetInteger(), and SetText().

bool XclPCItem::mbValue

Error code of an error item.

Definition at line 426 of file xlpivot.hxx.

Referenced by GetBool(), IsEqual(), and SetBool().

XclPCItemType XclPCItem::meType
private
double XclPCItem::mfValue

Definition at line 423 of file xlpivot.hxx.

Referenced by GetDouble(), IsEqual(), and SetDouble().

sal_uInt16 XclPCItem::mnError

Value of an integer item.

Definition at line 425 of file xlpivot.hxx.

Referenced by GetError(), IsEqual(), and SetError().

sal_Int16 XclPCItem::mnValue

Value of a floating-point item.

Definition at line 424 of file xlpivot.hxx.

Referenced by GetInteger(), IsEqual(), and SetInteger().


The documentation for this class was generated from the following files: