dca::Group Class Reference
[DCA Base Package]

#include <base_group.h>

List of all members.


Detailed Description

Encapsulates a group as defined in the related categories XML schema (see Categories XML: Groups).

See also:
Groups, Locales
void EnumerateCategoriesInfo( const dca::DcaInstance& myDca )
{
        // assume we have a successfully initialized DcaInstance myDca

        // get internal DCA categories info related to URL signature database...
        const dca::CategoriesInfo myCategoriesInfo = myDca.getCategoriesInfo( DCA_CAT_INFO_TYPE_URL );

        // enumerate categories...
        {
                const dca::Categories myCategories = myCategoriesInfo.getCategories();
                const DCA_SIZE_TYPE numOfCategories = myCategories.size();
                for( DCA_INDEX_TYPE i = 0; i < numOfCategories; ++i ) {
                        dca::Category myCategory = myCategories[ i ];
                        cout << (i+1)
                             << ") Category name=" << myCategory.name( "" )
                                 <<      ", id=" << myCategory.id()
                                 <<      ", groupId=" << myCategory.groupId() << endl;
                }
        }

        // enumerate groups...
        {
                const dca::Groups myGroups = myCategoriesInfo.getGroups();
                const DCA_SIZE_TYPE numOfGroups = myGroups.size();
                for( DCA_INDEX_TYPE i = 0; i < numOfGroups; ++i ) {
                        dca::Group myGroup = myGroups[ i ];
                        cout << (i+1)
                                 << ") Group name=" << myGroup.name( "" )
                                 << ", id=" << myGroup.id() << endl;
                }
        }

        // enumerate locales...
        {
                const dca::Locales myLocales = myCategoriesInfo.getLocales();
                const DCA_SIZE_TYPE numOfLocales = myLocales.size();
                for( DCA_INDEX_TYPE i = 0; i < numOfLocales; ++i ) {
                        dca::Locale myLocale = myLocales[ i ];
                        cout << (i+1)
                                 << ") Locale displayName='" << myLocale.displayName()
                                 << "', languageId='" << myLocale.languageId() << "'"
                                 << endl;
                }
        }
}

Definition at line 25 of file base_group.h.

Public Member Functions

bool operator== (const Group &aGroup) const
 Equality operator, returns true if aGroup.id() == this->id().
bool operator!= (const Group &aGroup) const
 Inequality operator, returns true if aGroup.id() != this->id().
DCA_GROUP_ID_TYPE id () const
 Returns the id of the group as defined in the related categories XML schema.
std::string name (const std::string &localeString=std::string()) const
 Returns the localized (display) name of the group.

Member Function Documentation

std::string dca::Group::name ( const std::string &  localeString = std::string()  )  const

Returns the localized (display) name of the group.

Parameters:
[in] localeString The name of the Locale to be used. Leave blank for using the default locale ("en_US")
Returns:
Localized group name.
Note:
The available locales for a given CategoriesInfo object can be obtained via the Locales class.

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

Generated on 26 Sep 2016 for dca_interface by  doxygen 1.6.1