ContentLanguageList Class Reference

#include <ContentLanguageList.h>

List of all members.

Public Member Functions

 ContentLanguageList ()
 ContentLanguageList (const ContentLanguageList &contentLanguages)
 ~ContentLanguageList ()
ContentLanguageListoperator= (const ContentLanguageList &contentLanguages)
Uint32 size () const
LanguageTag getLanguageTag (Uint32 index) const
void append (const LanguageTag &languageTag)
void remove (Uint32 index)
Uint32 find (const LanguageTag &languageTag) const
void clear ()
Boolean operator== (const ContentLanguageList &contentLanguages) const
Boolean operator!= (const ContentLanguageList &contentLanguages) const

Detailed Description

This class represents a list of content languages (such as may appear in an HTTP Content-Language header value). It is managed as a list of LanguageTag objects.


Constructor & Destructor Documentation

Copy constructor.

Parameters:
contentLanguagesThe ContentLanguageList object to copy.

Member Function Documentation

void ContentLanguageList::append ( const LanguageTag languageTag)

Appends a LanguageTag to the ContentLanguageList object.

Parameters:
languageTagThe LanguageTag to append.

Removes all the LanguageTags from the ContentLanguageList object.

Uint32 ContentLanguageList::find ( const LanguageTag languageTag) const

Finds the specified LanguageTag in the ContentLanguageList object and returns its index.

Parameters:
languageTagThe LanguageTag to find.
Returns:
Integer index of the LanguageTag, if found; otherwise PEG_NOT_FOUND.

Accesses a LanguageTag at a specified index.

Parameters:
indexInteger index of the LanguageTag to access. Valid indices range from 0 to size()-1.
Returns:
The LanguageTag corresponding to the specified index.
Exceptions:
IndexOutOfBoundsExceptionIf the specified index is out of range.
Boolean ContentLanguageList::operator!= ( const ContentLanguageList contentLanguages) const

Tests ContentLanguageList objects for inequality.

Parameters:
contentLanguagesA ContentLanguageList object to be compared.
Returns:
False if the ContentLanguageList objects contain the same LanguageTags in the same order, true otherwise.
ContentLanguageList& ContentLanguageList::operator= ( const ContentLanguageList contentLanguages)

Assignment operator.

Parameters:
contentLanguagesThe ContentLanguageList object to copy.
Boolean ContentLanguageList::operator== ( const ContentLanguageList contentLanguages) const

Tests ContentLanguageList objects for equality.

Parameters:
contentLanguagesA ContentLanguageList object to be compared.
Returns:
True if the ContentLanguageList objects contain the same LanguageTags in the same order, false otherwise.
void ContentLanguageList::remove ( Uint32  index)

Removes the specified LanguageTag from the ContentLanguageList object.

Parameters:
indexInteger index of the LanguageTag to remove.
Exceptions:
IndexOutOfBoundsExceptionIf the specified index is out of range.
Uint32 ContentLanguageList::size ( ) const

Returns the number of LanguageTags in the ContentLanguageList object.

Returns:
Integer size of the ContentLanguageList list.

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