MetadataTable Class Reference

MetadataTable is an implementation of MetadataElement that represents Table metadata. More...

#include <librets/MetadataTable.h>

Inheritance diagram for MetadataTable:

MetadataElement RetsObject

List of all members.

Public Types

enum  DataType {
  BOOLEAN, CHARACTER, DATE, DATE_TIME,
  TIME, TINY, SMALL, INT,
  LONG, DECIMAL
}
 Data types for tables. More...
enum  Interpretation {
  NUMBER, CURRENCY, LOOKUP, LOOKUP_MULTI,
  LOOKUP_BITSTRING, LOOKUP_BITMASK, NO_INTERPRETATION
}
enum  Alignment {
  LEFT, RIGHT, CENTER, JUSTIFY,
  NO_ALIGNMENT
}
enum  Units {
  FEET, METERS, SQUARE_FEET, SQUARE_METERS,
  ACRES, HECTARES, NO_UNITS
}

Public Member Functions

virtual MetadataType GetType () const
 Always returns TABLE.
virtual std::string GetId () const
 Returns the ID attribute.
std::string GetSystemName () const
 Returns the system name for this field.
std::string GetStandardName () const
 Returns the standard name for this field.
std::string GetLongName () const
 Returns the long, descriptive name for this field.
std::string GetDBName () const
 Returns the DB name for this field.
std::string GetShortName () const
 Return the short name for this field.
int GetMaximumLength () const
 Return the maximum length for this field.
DataType GetDataType () const
 Returns the data type for this field.
int GetPrecision () const
 Returns the maximum length of this field, in characters.
bool IsSearchable () const
 Returns true if this field is searchable.
Interpretation GetInterpretation () const
 Returns the intepretation of this field.
Alignment GetAlignment () const
 Return the alignment of this field.
bool UseSeparator () const
 Return whether or not this field uses a separator.
std::string GetEditMaskId () const
 Return the edit mask ID for this field.
std::string GetLookupName () const
 Return the lookup name for this field.
int GetMaxSelect () const
 Return the Max Select value for this field.
Units GetUnits () const
 Return the units type for this field.
int GetIndex () const
 Return the index for this field.
int GetMinimum () const
 Get the minimum value for this field.
std::string GetMinimumAsString () const
 Get the minimum value for this field as a string.
int GetMaximum () const
 Get the maximum value for this field.
std::string GetMaximumAsString () const
 Get the maximum value for this field as a string.
int GetDefault () const
 Get the default value for this field.
int GetRequired () const
 Get whether or not this is a required field for searching.
std::string GetSearchHelpId () const
 Get the Search Help ID.
bool IsUnique () const
 Get whether or not this field is supposed to be unique.
bool UpdatesModTimeStamp () const
 Returns true if changes to this field update the class's ModTimeStamp field.
std::string GetForeignKey () const
 When nonblank, indicate that this field is normally populated via this foreign key.
std::string GetForeignField () const
 Returns the SystemName from the child record accessed via the specified foreign key.
bool GetKeyRetrievalQuery () const
bool GetKeyRetrievalSelect () const
bool InKeyIndex () const
 Returns true when this field may be included in the Select list of a query in order to suppress normal Limit behavior.
StringVector GetAttributeNames () const
 Returns all attirbute names.
std::string GetStringAttribute (std::string attributeName, std::string defaultValue="") const
 Returns the value of an attribute.
int GetIntAttribute (std::string attributeName, int defaultValue=0) const
 Returns the value of an attribute as an integer.
bool GetBoolAttribute (std::string attributeName, bool defaultValue=false) const
 Returns the value of an attribute as a boolean.
void SetAttribute (std::string attributeName, std::string attributeValue)
 Set the value of an attribute.
std::string GetLevel () const
 Returns the level of the current metadata element.
void SetLevel (std::string level)
 Set the level for the current metadata element.
std::string GetPath () const
 Returns the path of this element.
std::string GetMetadataEntryID () const
 Returns the MetadataEntryId for the element.
virtual std::ostream & Print (std::ostream &outputStream) const
 Prints the attribute in a standard form for debugging and error reporting.
std::string ToString () const
virtual bool Equals (const RetsObject *object) const

Protected Attributes

StringMap mAttributes
std::string mLevel


Detailed Description

MetadataTable is an implementation of MetadataElement that represents Table metadata.

Member Typedef Documentation

typedef MetadataType Type [inherited]


Member Enumeration Documentation

enum Alignment

Enumerator:
LEFT 
RIGHT 
CENTER 
JUSTIFY 
NO_ALIGNMENT 

enum DataType

Data types for tables.

Enumerator:
BOOLEAN  A boolean stored as 1 for true and 0 for false.

CHARACTER  An arbitrary sequence of characters.

DATE  A date stored in YYYY-MM-DD format.

DATE_TIME  A timestamp stored in YYYY-MM-DDThh:mm:ss[.SSS] format.

TIME  A time stored in hh:mm:ss[.SSS] format.

TINY  A signed numeric value that can be stored in 8 bits.

SMALL  A signed numeric value that can be stored in 16 bits.

INT  A signed numeric value that can be stored in 32 bits.

LONG  A signed numeric value that can be stored in 32 bits.

DECIMAL  A decimal value that contains a decimal point.

Enumerator:
NUMBER 
CURRENCY 
LOOKUP  Lookup metadata.

LOOKUP_MULTI 
LOOKUP_BITSTRING 
LOOKUP_BITMASK 
NO_INTERPRETATION 

enum MetadataType [inherited]

Metadata types.

Enumerator:
SYSTEM  System metadata.

RESOURCE  Resource metadata.

CLASS  Class metadata.

TABLE  Table metadata.

UPDATE  Update metadata.

UPDATE_TYPE  Update type metadata.

OBJECT  Object metadata.

SEARCH_HELP  Search help metadata.

EDIT_MASK  Edit mask metadata.

LOOKUP  Lookup metadata.

LOOKUP_TYPE  Lookup type metadata.

UPDATE_HELP  Update help metadata.

VALIDATION_LOOKUP  Validation lookup metadata.

VALIDATION_LOOKUP_TYPE  Validation lookup type metadata.

VALIDATION_EXTERNAL  Validation external metadata.

VALIDATION_EXTERNAL_TYPE  Validation external type metadata.

VALIDATION_EXPRESSION  Validation expression metadata.

FOREIGN_KEY  Foreign key metadata.

enum Units

Enumerator:
FEET 
METERS 
SQUARE_FEET 
SQUARE_METERS 
ACRES 
HECTARES 
NO_UNITS 


Member Function Documentation

virtual bool Equals ( const RetsObject object  )  const [virtual, inherited]

Alignment GetAlignment (  )  const

Return the alignment of this field.

Returns:
An enum representing the alignment of this field.

StringVector GetAttributeNames (  )  const [inherited]

Returns all attirbute names.

Returns:
all attribute names

bool GetBoolAttribute ( std::string  attributeName,
bool  defaultValue = false 
) const [inherited]

Returns the value of an attribute as a boolean.

Parameters:
attributeName A string containing the name of the attribute.
defaultValue The value to use if the attribute does not exist.
Returns:
The value of the attribute as a boolean.

DataType GetDataType (  )  const

Returns the data type for this field.

Returns:
The data type for this field

std::string GetDBName (  )  const

Returns the DB name for this field.

Returns:
A string representing the DB name.

int GetDefault (  )  const

Get the default value for this field.

Returns:
An integer represnting the default value

std::string GetEditMaskId (  )  const

Return the edit mask ID for this field.

Returns:
A string representing the edit mask ID.

std::string GetForeignField (  )  const

Returns the SystemName from the child record accessed via the specified foreign key.

Returns:
SystemName of the foreign key for the child.

std::string GetForeignKey (  )  const

When nonblank, indicate that this field is normally populated via this foreign key.

Returns:
Blank or a foriegn key.

virtual std::string GetId (  )  const [virtual]

Returns the ID attribute.

The ID attribute is a non-empty and unique field used to identify this element within the scope of elements of the same type. Not all metadata elements have an identifying attribute. In these cases, an empty string is returned. The default implementation returns an empty string. Subclasses should override as needed.

Returns:
the ID attribute, if there is one

Reimplemented from MetadataElement.

int GetIndex (  )  const

Return the index for this field.

Returns:
An integer representing the index.

int GetIntAttribute ( std::string  attributeName,
int  defaultValue = 0 
) const [inherited]

Returns the value of an attribute as an integer.

Parameters:
attributeName A string containing the name of the attribute.
defaultValue The value to use if the attribute does not exist.
Returns:
The value of the attribute as an integer.

Interpretation GetInterpretation (  )  const

Returns the intepretation of this field.

Returns:
An enum representing the interpretation of this field.

bool GetKeyRetrievalQuery (  )  const

Deprecated:
Returns true when this field may be included in a query that uses the Key optional argument.
Returns:
true when may be used with Key optional argument.

bool GetKeyRetrievalSelect (  )  const

Deprecated:
Returns true when this field may be included in the Select list of a query that uses the option Key argument.
Returns:
true when may be used in Select list.

std::string GetLevel (  )  const [inherited]

Returns the level of the current metadata element.

Returns:
A string containing the level.

std::string GetLongName (  )  const

Returns the long, descriptive name for this field.

Returns:
The long name for this field

std::string GetLookupName (  )  const

Return the lookup name for this field.

Returns:
A string representing the lookup name.

int GetMaximum (  )  const

Get the maximum value for this field.

Returns:
An integer representing the maximum value.

std::string GetMaximumAsString (  )  const

Get the maximum value for this field as a string.

This is a workaround to allow the ability to fetch maximum values for floating point fields. It is up to the user code to handle the parsing of this value.

Returns:
A string representing the maximum value of this field.

int GetMaximumLength (  )  const

Return the maximum length for this field.

Returns:
An integer representing the maximum length

int GetMaxSelect (  )  const

Return the Max Select value for this field.

Returns:
An integer representing the maximum select value.

std::string GetMetadataEntryID (  )  const [inherited]

Returns the MetadataEntryId for the element.

Returns:
MetadataEntryId

int GetMinimum (  )  const

Get the minimum value for this field.

Returns:
An integer representing the minimum value.

std::string GetMinimumAsString (  )  const

Get the minimum value for this field as a string.

This is a workaround to allow the ability to fetch minimum values for floating point fields. It is up to the user code to handle the parsing of this value.

Returns:
A string represnting the minimum value of this field.

std::string GetPath (  )  const [inherited]

Returns the path of this element.

The path uniquely identifies this metadata element amongst all elements of the same type. Since this relies on the ID attribute, only those elements with an ID attribute have a non-empty path.

Returns:
the unique path

int GetPrecision (  )  const

Returns the maximum length of this field, in characters.

For numeric fields, this is the display length rather than the storage length, and iuncludes all formatting such as the sign, decimal point, commas or other insertion edits.

Returns:
The maximum length of this field, in characters

int GetRequired (  )  const

Get whether or not this is a required field for searching.

Returns:
An integer representing the value.

std::string GetSearchHelpId (  )  const

Get the Search Help ID.

Returns:
A string representing the Search Help ID.

std::string GetShortName (  )  const

Return the short name for this field.

Returns:
A string representing the short name.

std::string GetStandardName (  )  const

Returns the standard name for this field.

If this table has no standard name, then an empty string is returned.

Returns:
The standard name for this field

std::string GetStringAttribute ( std::string  attributeName,
std::string  defaultValue = "" 
) const [inherited]

Returns the value of an attribute.

Parameters:
attributeName A string containing the name of the attribute.
defaultValue The value to use if the attribute does not exist.
Returns:
The value of the attribute as a string.

std::string GetSystemName (  )  const

Returns the system name for this field.

Returns:
The system name for this field.

virtual MetadataType GetType (  )  const [virtual]

Always returns TABLE.

Returns:
TABLE

Implements MetadataElement.

Units GetUnits (  )  const

Return the units type for this field.

Returns:
An enum representing the units.

bool InKeyIndex (  )  const

Returns true when this field may be included in the Select list of a query in order to suppress normal Limit behavior.

Returns:
true when may be used in Select list.

bool IsSearchable (  )  const

Returns true if this field is searchable.

Returns:
true if this field is searchable

bool IsUnique (  )  const

Get whether or not this field is supposed to be unique.

Returns:
A boolean that when TRUE indicates the field should be unique.

virtual std::ostream& Print ( std::ostream &  outputStream  )  const [virtual, inherited]

Prints the attribute in a standard form for debugging and error reporting.

Reimplemented from RetsObject.

void SetAttribute ( std::string  attributeName,
std::string  attributeValue 
) [inherited]

Set the value of an attribute.

Parameters:
attributeName A string containing the name of the attribute.
attributeValue A string containing the value of the attribute.

void SetLevel ( std::string  level  )  [inherited]

Set the level for the current metadata element.

Parameters:
level A string containing the level.

std::string ToString (  )  const [inherited]

bool UpdatesModTimeStamp (  )  const

Returns true if changes to this field update the class's ModTimeStamp field.

Returns:
true if changes update ModTimeStamp.

bool UseSeparator (  )  const

Return whether or not this field uses a separator.

Returns:
A boolen that if TRUE indications that a separator is used.


Member Data Documentation

StringMap mAttributes [protected, inherited]

std::string mLevel [protected, inherited]


Generated by  doxygen