dca_interface  6.3.4
dca_ipr::IprCategoriesInfo Class Reference

#include <ipr_categoriesinfo.h>

Detailed Description

Container class for all IPR enumeration objects.

Can be obtained from a IprClassification object.

You can use the related member functions to enumerate all locales, enums and categories.

See also
IprClassification, IprLocales, IprCategories

The following sample code shows how to iterate over the data contained in a IprCategoriesInfo object:

void EnumerateIprCategoriesInfo( const dca_ipr::IprCategoriesInfo& myCategoriesInfo )
{
// assume we have a successfully initialized myCategoriesInfo
// enumerate locales...
{
const dca_ipr::IprLocales myLocales = myCategoriesInfo.getLocales();
const DCA_SIZE_TYPE numOfItems = myLocales.size();
for( DCA_INDEX_TYPE i = 0; i < numOfItems; ++i ) {
const dca_ipr::IprLocale myLocale = myLocales[ i ];
cout << (i+1)
<< ") Locale languageid='" << myLocale.langugageId()
<< "', displayname='" << myLocale.displayName()
<< endl;
}
}
// enumerate categories...
{
const dca_ipr::IprCategories myCategories = myCategoriesInfo.getCategories();
const DCA_SIZE_TYPE numOfItems = myCategories.size();
for( DCA_INDEX_TYPE i = 0; i < numOfItems; ++i ) {
const dca_ipr::IprCategory myCategory = myCategories[ i ];
cout << (i+1)
<< ") Category name=" << myCategory.name( "" )
<< ", id=" << myCategory.id() << endl;
}
}
// enumerate enums...
{
const dca_ipr::IprEnums myEnums = myCategoriesInfo.getEnums();
const DCA_SIZE_TYPE numOfItems = myEnums.size();
for( DCA_INDEX_TYPE i = 0; i < numOfItems; ++i ) {
const dca_ipr::IprEnum myEnum = myEnums[ i ];
cout << (i+1)
<< ") Enum name=" << myEnum.name( "" )
<< ", id=" << myEnum.id() << endl;
}
}
}

Definition at line 39 of file ipr_categoriesinfo.h.

Public Member Functions

IprLocales getLocales () const
 Returns the contained IprLocales.
 
IprCategories getCategories () const
 Returns the contained IprCategories.
 
IprEnums getEnums () const
 Returns the contained IprEnums.
 

The documentation for this class was generated from the following file:
Encapsulation of a locale class, which allows access to the language id and the display name of local...
Definition: ipr_locale.h:27
DCA_SIZE_TYPE size() const
Returns the number of locales in the container.
DCA_SIZE_TYPE size() const
Returns the number of enums in the container.
IprEnums getEnums() const
Returns the contained IprEnums.
Container class for all IPR enumeration objects.
DCA_ENUM_ID_TYPE id() const
Returns the internal id of the enumerable item.
IprCategories getCategories() const
Returns the contained IprCategories.
DCA_SIZE_TYPE size() const
Returns the number of categories in the container.
std::string name(const std::string &localeString=std::string()) const
Returns the localized (display) name of the category.
std::string displayName() const
Returns the display name of the locale.
The IprEnum class describes a single enumerable item, for example the Geo Location "Greenland".
Definition: ipr_enum.h:26
std::string name(const std::string &localeString=std::string()) const
Returns the localized (display) name of the enumerable item.
Definition of a container class for IprEnum objects.
Definition: ipr_enums.h:30
DCA_CATEGORY_ID_TYPE id() const
Returns the internal id of a IprCategory class.
size_t DCA_INDEX_TYPE
Type for index access (used for arrays and collections).
Definition: base_types.h:66
size_t DCA_SIZE_TYPE
Type for size (used for size of array and collections).
Definition: base_types.h:72
Definition of a container class for IprCategory objects.
Definition of a container class for IprLocale objects.
Definition: ipr_locales.h:33
The IprCategory class contains information for a single category. An IP address can be assigned to on...
Definition: ipr_category.h:27
IprLocales getLocales() const
Returns the contained IprLocales.