Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::ContactInfo Class Reference

ContactInfo object. More...

Inheritance diagram for gem::ContactInfo:
Collaboration diagram for gem::ContactInfo:

Public Member Functions

 ContactInfo (const ContactInfo &)=default
 Default copy constructor.
 ContactInfo (ContactInfo &&)=default
 Default move constructor noexcept is deduced.
ContactInfo & operator= (const ContactInfo &ci)=default
 Default copy assignment.
ContactInfo & operator= (ContactInfo &&ci)=default
 Default move assignment noexcept is deduced.
bool operator== (const ContactInfo &ci) const
 Comparison operator equal.
bool operator!= (const ContactInfo &ci) const
 Comparison operator not equal.
int getFieldsCount () const
 Gets the field count.
EContactInfoFieldType getFieldType (int index) const
 Gets the field type.
const StringRef getFieldName (int index) const
 Gets the field name/short description.
const StringRef getFieldValue (int index) const
 Gets the field value.
template<typename TCollector>
bool iterateFields (TCollector collector, EContactInfoFieldType type=EContactInfoFieldType::FT_Last) const
 Iterate all fields via a collector.
ContactInfo & setField (int index, EContactInfoFieldType type, String const &value, String const &name) noexcept
 Sets field type, value and name.
ContactInfo & addField (EContactInfoFieldType type, const String &value, const String &name) noexcept
 Adds a new field.
ContactInfo & removeField (int index)
 Removes a field specified by index.

Detailed Description

ContactInfo object.

It specifies the structure of the information used to contact a person ( ex. phone number, email, home page), as a list of TContactInfoFieldType "fields".

Implements share-read / copy-on-write Api object over IContactInfo.

Member Function Documentation

◆ addField()

ContactInfo & gem::ContactInfo::addField ( EContactInfoFieldType type,
const String & value,
const String & name )
inlinenoexcept

Adds a new field.

Parameters
[in]typeField's type
[in]valueField's value
[in]nameField's name
Returns
A reference to this object

◆ getFieldName()

const StringRef gem::ContactInfo::getFieldName ( int index) const
inline

Gets the field name/short description.

Parameters
[in]indexField index
Returns
The field name

◆ getFieldsCount()

int gem::ContactInfo::getFieldsCount ( ) const
inline

Gets the field count.

Returns
The field count

◆ getFieldType()

EContactInfoFieldType gem::ContactInfo::getFieldType ( int index) const
inline

Gets the field type.

Parameters
[in]indexField index
Returns
The field type

◆ getFieldValue()

const StringRef gem::ContactInfo::getFieldValue ( int index) const
inline

Gets the field value.

Parameters
[in]indexField index
Returns
The field value

◆ iterateFields()

template<typename TCollector>
bool gem::ContactInfo::iterateFields ( TCollector collector,
EContactInfoFieldType type = EContactInfoFieldType::FT_Last ) const
inline

Iterate all fields via a collector.

Collector should have the following signature bool(int, TContactInfoFieldType, String, String )

Returns true if iteration should continue and false if iteration should stop

Parameters
[in]collectorThe collector
[in]typeThe field type to iterate over
Returns
True if iteration was successful, false otherwise
Template Parameters
TCollectorThe collector type

◆ operator!=()

bool gem::ContactInfo::operator!= ( const ContactInfo & ci) const
inline

Comparison operator not equal.

Parameters
[in]ciThe object to be compared
Returns
True if the objects are not equal, false otherwise

◆ operator=() [1/2]

ContactInfo & gem::ContactInfo::operator= ( const ContactInfo & ci)
default

Default copy assignment.

Returns
A reference to this object
Parameters
[in]ciThe object to be copied

◆ operator=() [2/2]

ContactInfo & gem::ContactInfo::operator= ( ContactInfo && ci)
default

Default move assignment noexcept is deduced.

Returns
A reference to this object
Parameters
[in]ciThe object to be moved

◆ operator==()

bool gem::ContactInfo::operator== ( const ContactInfo & ci) const
inline

Comparison operator equal.

Parameters
[in]ciThe object to be compared
Returns
True if the objects are equal, false otherwise

◆ removeField()

ContactInfo & gem::ContactInfo::removeField ( int index)
inline

Removes a field specified by index.

Parameters
[in]indexField index
Returns
A reference to this object

◆ setField()

ContactInfo & gem::ContactInfo::setField ( int index,
EContactInfoFieldType type,
String const & value,
String const & name )
inlinenoexcept

Sets field type, value and name.

Parameters
[in]indexField index
[in]typeField's type
[in]valueField's value
[in]nameField's name
Returns
A reference to this object