AcceptLanguageList Class Reference
#include <AcceptLanguageList.h>
List of all members.
Detailed Description
This class represents an list of languages that a reader can understand (as may be specified in an HTTP Accept-Language header value). It is managed as a prioritized list of LanguageTag objects and quality values.
Constructor & Destructor Documentation
AcceptLanguageList::AcceptLanguageList |
( |
|
) |
|
Copy constructor.
- Parameters:
-
AcceptLanguageList::~AcceptLanguageList |
( |
|
) |
|
Member Function Documentation
void AcceptLanguageList::clear |
( |
|
) |
|
Uint32 AcceptLanguageList::find |
( |
const LanguageTag & |
languageTag |
) |
const |
Finds the first occurrence of the specified LanguageTag in the AcceptLanguageList object and returns its index.
- Parameters:
-
- Returns:
- Integer index of the element, if found; otherwise PEG_NOT_FOUND.
LanguageTag AcceptLanguageList::getLanguageTag |
( |
Uint32 |
index |
) |
const |
Accesses an LanguageTag at a specified index.
- Parameters:
-
| index | Integer index of the LanguageTag to access. Valid indices range from 0 to size()-1. |
- Returns:
- The LanguageTag corresponding to the specified index.
- Exceptions:
-
Real32 AcceptLanguageList::getQualityValue |
( |
Uint32 |
index |
) |
const |
Accesses a quality value at a specified index (corresponding to a language tag).
- Parameters:
-
| index | Integer index of the quality value to access. Valid indices range from 0 to size()-1. |
- Returns:
- The quality value corresponding to the specified index.
- Exceptions:
-
void AcceptLanguageList::insert |
( |
const LanguageTag & |
languageTag, |
|
|
Real32 |
qualityValue | |
|
) |
| | |
Inserts a LanguageTag and quality value into the AcceptLanguageList object. The element is inserted in order of descending quality value and after any other elements with the same quality value.
- Parameters:
-
| languageTag | The LanguageTag to insert. |
| qualityValue | The quality value to insert. |
Boolean AcceptLanguageList::operator!= |
( |
const AcceptLanguageList & |
acceptLanguages |
) |
const |
Tests AcceptLanguageList objects for inequality.
- Parameters:
-
- Returns:
- False if the AcceptLanguageList objects contain the same LanguageTags and quality values in the same order, true otherwise.
Assignment operator.
- Parameters:
-
Boolean AcceptLanguageList::operator== |
( |
const AcceptLanguageList & |
acceptLanguages |
) |
const |
Tests AcceptLanguageList objects for equality.
- Parameters:
-
- Returns:
- True if the AcceptLanguageList objects contain the same LanguageTags and quality values in the same order, false otherwise.
void AcceptLanguageList::remove |
( |
Uint32 |
index |
) |
|
Removes the specified LanguageTag and quality value from the AcceptLanguageList object.
- Parameters:
-
| index | Integer index of the element to remove. |
- Exceptions:
-
Uint32 AcceptLanguageList::size |
( |
|
) |
const |
The documentation for this class was generated from the following file: