CitySDK iOS Library
 All Classes Functions Variables Enumerations Enumerator Properties
Class Methods | Protected Types | List of all members
DataReader Class Reference

Used as an aid to get data from a POI-based object. More...

Inheritance diagram for DataReader:

Class Methods

(void) + setDefaultLocale:
 Sets the default locale. If locale is nil, it defaults to en_GB. More...
 
(NSDictionary *) + getAvailableLangs:fromField:
 Gets a mapping of all the available languages in a given field (description or label) of the POI object. More...
 
(NSString *) + getLabel:withTerm:andLocale:
 Gets the label with the given term in a given language. More...
 
(NSString *) + getDescription:withLocale:
 Gets the description in a given language. More...
 
(NSString *) + getPrice:withLocale:
 Gets the price in a given language. More...
 
(NSString *) + getWaitingTime:
 Gets the waiting time in a given language. More...
 
(NSString *) + getOccupation:
 Gets the occupation in a given language. More...
 
(NSArray *) + getThumbnails:
 Gets all the thumbnails in 64-base bytecode or URI. More...
 
(NSArray *) + getLocationGeometry:withTerm:
 Gets a list of points of the POI object with the given term. More...
 
(NSArray *) + getLocationPoint:withTerm:
 Gets a list of points of the POI object with the given term. It only checks the GeoPoint geometry. More...
 
(NSArray *) + getLocationLine:withTerm:
 Gets a list of lines of the POI object with the given term. It only checks the Line geometry. More...
 
(NSArray *) + getLocationPolygon:withTerm:
 Gets a list of polygons of the POI object with the given term. It only checks the Polygon geometry. More...
 
(NSString *) + getContacts:
 Gets the contacts in vCard format. More...
 
(NSString *) + getCalendar:withTerm:
 Returns an a calendar in iCalendar format of the given term. More...
 
(NSArray *) + getImagesUri:
 Gets all the URI images of the given POI object. More...
 
(NSString *) + getRelationshipBase:withTerm:
 Gets the relationship base with a given term. More...
 
(NSString *) + getRelationshipId:withTerm:
 Gets the relationship id with a given term. More...
 
(NSString *) + getLink:withTerm:
 Returns the link with a given term. More...
 
(NSArray *) + getTags:withLocale:
 Gets the tags within the list of tags in a given language. More...
 

Protected Types

enum  field { FIELD_LABELS, FIELD_DESCRIPTIONS }
 
typedef enum DataReader::field Field
 

Detailed Description

Used as an aid to get data from a POI-based object.

It abstract the parsing of data and gets the information needed specified by the application using a given set of terms or languages. In case a given language is not found, it defaults to en_GB.

Author
Pedro Cruz

Member Enumeration Documentation

- (enum) field
protected
Enumerator
FIELD_LABELS 

to read the labels field

FIELD_DESCRIPTIONS 

to read the descriptions field

Method Documentation

+ (NSDictionary *) getAvailableLangs: (POI *)  poi
fromField: (Field)  field 

Gets a mapping of all the available languages in a given field (description or label) of the POI object.

Parameters
poithe object to get the data.
fieldthe desired field to check (FIELD_LABELS or FIELD_DESCRIPTIONS)
Returns
a mapping of language codes (e.g.: pt, en) and the respective locale for a given field.
+ (NSString *) getCalendar: (POI *)  poi
withTerm: (Term)  term 

Returns an a calendar in iCalendar format of the given term.

Parameters
poithe object to get the data.
termthe term to search for.
Returns
a NSString containing the information in iCalendar format with the given term or nil if none were found.
+ (NSString *) getContacts: (POI *)  poi

Gets the contacts in vCard format.

Parameters
poithe object to get the data.
Returns
a NSString containing the information in vCard format or nil if none were found.
+ (NSString *) getDescription: (POI *)  poi
withLocale: (NSLocale *)  locale 

Gets the description in a given language.

Parameters
poithe object to get the data.
localethe wanted language.
Returns
a NSString containing the following: the value of the description in the desired language or in the default language if none found or nil.
+ (NSArray *) getImagesUri: (POI *)  poi

Gets all the URI images of the given POI object.

Parameters
poithe object to get the data.
Returns
the list of URIs (ImageContent) of the images or an empty list if none were found.
+ (NSString *) getLabel: (POI *)  poi
withTerm: (Term)  term
andLocale: (NSLocale *)  locale 

Gets the label with the given term in a given language.

Parameters
poithe object to get the data.
termthe term used.
localethe wanted language.
Returns
a NSString containing the following: the value of the label in the given language. If such language is not found it will return in default language and if the default language is not present it will return nil.
+ (NSString *) getLink: (POI *)  poi
withTerm: (Term)  term 

Returns the link with a given term.

Parameters
poithe object to get the data.
termthe term used
Returns
a NSString containing a link or null if none found.
+ (NSArray *) getLocationGeometry: (POI *)  poi
withTerm: (Term)  term 

Gets a list of points of the POI object with the given term.

Parameters
poithe object to get the data.
termthe term to be used.
Returns
a list (of GeometryContent) containing all geometries with the given term or an empty list.
+ (NSArray *) getLocationLine: (POI *)  poi
withTerm: (Term)  term 

Gets a list of lines of the POI object with the given term. It only checks the Line geometry.

Parameters
poithe object to get the data.
termthe term to be used.
Returns
a list (of LineContent) containing all lines with the given term or an empty list.
+ (NSArray *) getLocationPoint: (POI *)  poi
withTerm: (Term)  term 

Gets a list of points of the POI object with the given term. It only checks the GeoPoint geometry.

Parameters
poithe object to get the data.
termthe term to be used.
Returns
a list (of PointContent) containing all points with the given term or an empty list.
+ (NSArray *) getLocationPolygon: (POI *)  poi
withTerm: (Term)  term 

Gets a list of polygons of the POI object with the given term. It only checks the Polygon geometry.

Parameters
poithe object to get the data.
termthe term to be used.
Returns
a list (of PolygonContent) containing all polygons with the given term or an empty list.
+ (NSString *) getOccupation: (POI *)  poi

Gets the occupation in a given language.

Parameters
poithe object to get the data.
Returns
a NSString containing the occupation value (0 to 100) or nil.
+ (NSString *) getPrice: (POI *)  poi
withLocale: (NSLocale *)  locale 

Gets the price in a given language.

Parameters
poithe object to get the data.
localethe wanted language.
Returns
a NSString containing the following: the value of the price in the desired language or in the default language if it was not found or nil if the default language is not present.
+ (NSString *) getRelationshipBase: (POI *)  poi
withTerm: (Term)  term 

Gets the relationship base with a given term.

Parameters
poithe object to get the data.
termthe term used.
Returns
a NSString containing the relationship base with the given term or nil if none was found.
+ (NSString *) getRelationshipId: (POI *)  poi
withTerm: (Term)  term 

Gets the relationship id with a given term.

Parameters
poithe object to get the data.
termthe term used.
Returns
a NSString containing the relationship id with the given term or null if none was found.
+ (NSArray *) getTags: (ListTag *)  tags
withLocale: (NSLocale *)  locale 

Gets the tags within the list of tags in a given language.

Parameters
tagsthe list of tags.
localethe wanted language.
Returns
a list of tags in the given language, or an empty list if none was found.
+ (NSArray *) getThumbnails: (POI *)  poi

Gets all the thumbnails in 64-base bytecode or URI.

Parameters
poithe object to get the data.
Returns
a list of ImageContent where each element contains the following: the bytecode (base-64) or URI of the thumbnail, or an empty list if none found.
+ (NSString *) getWaitingTime: (POI *)  poi

Gets the waiting time in a given language.

Parameters
poithe object to get the data.
Returns
a NSString containing the waiting time (in seconds) or nil.
+ (void) setDefaultLocale: (NSLocale *)  locale

Sets the default locale. If locale is nil, it defaults to en_GB.

Parameters
localethe wanted default locale.

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