|
Unity Scopes API
|
Metadata passed with search requests. More...
#include <unity/scopes/SearchMetadata.h>

Public Member Functions | |
| SearchMetadata (std::string const &locale, std::string const &form_factor) | |
| Create SearchMetadata with the given locale and form factor. More... | |
| SearchMetadata (int cardinality, std::string const &locale, std::string const &form_factor) | |
| Create SearchMetadata with the given cardinality, locale, and form factor. More... | |
| void | set_cardinality (int cardinality) |
| Set cardinality. More... | |
| int | cardinality () const |
| Get cardinality. More... | |
| void | set_location (Location const &location) |
| Set location. More... | |
| Location | location () const |
| Get location. More... | |
| bool | has_location () const |
| Does the SearchMetadata have a location. More... | |
| void | set_hint (std::string const &key, Variant const &value) |
| Sets a hint. More... | |
| VariantMap | hints () const |
| Get all hints. More... | |
| bool | contains_hint (std::string const &key) const |
| Check if this SearchMetadata has a hint. More... | |
| Variant & | operator[] (std::string const &key) |
| Returns a reference to a hint. More... | |
| Variant const & | operator[] (std::string const &key) const |
| Returns a const reference to a hint. More... | |
Copy and assignment | |
Copy and assignment operators (move and non-move versions) have the usual value semantics. | |
| SearchMetadata (SearchMetadata const &other) | |
| SearchMetadata (SearchMetadata &&) | |
| SearchMetadata & | operator= (SearchMetadata const &other) |
| SearchMetadata & | operator= (SearchMetadata &&) |
Public Member Functions inherited from unity::scopes::QueryMetadata | |
| std::string | locale () const |
| Get the locale string. More... | |
| std::string | form_factor () const |
| Get the form factor string. More... | |
| void | set_internet_connectivity (ConnectivityStatus connectivity_status) |
| Set internet connectivity status. More... | |
| ConnectivityStatus | internet_connectivity () const |
| Get internet connectivity status. More... | |
Additional Inherited Members | |
Public Types inherited from unity::scopes::QueryMetadata | |
| enum | ConnectivityStatus { Unknown, Connected, Disconnected } |
| Indicates the internet connectivity status. More... | |
Metadata passed with search requests.
| unity::scopes::SearchMetadata::SearchMetadata | ( | std::string const & | locale, |
| std::string const & | form_factor | ||
| ) |
Create SearchMetadata with the given locale and form factor.
| locale | locale string, eg. en_EN |
| form_factor | form factor name, e.g. phone, desktop, phone-version etc. |
| unity::scopes::SearchMetadata::SearchMetadata | ( | int | cardinality, |
| std::string const & | locale, | ||
| std::string const & | form_factor | ||
| ) |
Create SearchMetadata with the given cardinality, locale, and form factor.
| cardinality | maximum number of search results |
| locale | locale string, eg. en_EN |
| form_factor | form factor name, e.g. phone, desktop, phone-version etc. |
| int unity::scopes::SearchMetadata::cardinality | ( | ) | const |
Get cardinality.
| bool unity::scopes::SearchMetadata::contains_hint | ( | std::string const & | key | ) | const |
Check if this SearchMetadata has a hint.
| key | The hint name. |
| bool unity::scopes::SearchMetadata::has_location | ( | ) | const |
Does the SearchMetadata have a location.
| VariantMap unity::scopes::SearchMetadata::hints | ( | ) | const |
Get all hints.
| unity::NotFoundException | if no hints are available. |
| Location unity::scopes::SearchMetadata::location | ( | ) | const |
Get location.
| unity::NotFoundException | if no location data is available. |
| Variant & unity::scopes::SearchMetadata::operator[] | ( | std::string const & | key | ) |
Returns a reference to a hint.
This method can be used to read or set hints. Setting a value of an existing hint overwrites its previous value. Referencing a non-existing hint automatically creates it with a default value of Variant::Type::Null.
| key | The name of the hint. |
| Variant const & unity::scopes::SearchMetadata::operator[] | ( | std::string const & | key | ) | const |
Returns a const reference to a hint.
This method can be used for read-only access to hints. Referencing a non-existing hint throws unity::InvalidArgumentException.
| key | The name of the hint. |
| unity::NotFoundException | if no hint with the given name exists. |
| void unity::scopes::SearchMetadata::set_cardinality | ( | int | cardinality | ) |
Set cardinality.
| cardinality | The maximum number of search results. |
| void unity::scopes::SearchMetadata::set_hint | ( | std::string const & | key, |
| Variant const & | value | ||
| ) |
Sets a hint.
| key | The name of the hint. |
| value | Hint value |
| void unity::scopes::SearchMetadata::set_location | ( | Location const & | location | ) |
Set location.
| location | Location data. |