ContentLanguageList Class Reference

#include <ContentLanguageList.h>

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

◆ ContentLanguageList() [1/2]

ContentLanguageList::ContentLanguageList ( )

Constructs an empty ContentLanguageList object.

◆ ContentLanguageList() [2/2]

ContentLanguageList::ContentLanguageList ( const ContentLanguageList contentLanguages)

Copy constructor.

Parameters
contentLanguagesThe ContentLanguageList object to copy.

◆ ~ContentLanguageList()

ContentLanguageList::~ContentLanguageList ( )

Destructor.

Member Function Documentation

◆ append()

void ContentLanguageList::append ( const LanguageTag languageTag)

Appends a LanguageTag to the ContentLanguageList object.

Parameters
languageTagThe LanguageTag to append.

◆ clear()

void ContentLanguageList::clear ( )

Removes all the LanguageTags from the ContentLanguageList object.

◆ find()

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.

◆ getLanguageTag()

LanguageTag ContentLanguageList::getLanguageTag ( Uint32  index) const

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.

◆ operator!=()

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.

◆ operator=()

ContentLanguageList& ContentLanguageList::operator= ( const ContentLanguageList contentLanguages)

Assignment operator.

Parameters
contentLanguagesThe ContentLanguageList object to copy.

◆ operator==()

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.

◆ remove()

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.

◆ size()

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: