1 a.dunfey 1.1.2.2 //%2005////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
6 // IBM Corp.; EMC Corporation, The Open Group.
7 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
11 //
12 // Permission is hereby granted, free of charge, to any person obtaining a copy
13 // of this software and associated documentation files (the "Software"), to
14 // deal in the Software without restriction, including without limitation the
15 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16 // sell copies of the Software, and to permit persons to whom the Software is
17 // furnished to do so, subject to the following conditions:
18 //
19 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
20 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
21 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
22 a.dunfey 1.1.2.2 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
23 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
25 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //==============================================================================
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_ContentLanguageList_h
33 #define Pegasus_ContentLanguageList_h
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/LanguageTag.h>
37
38 #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
39
40 PEGASUS_NAMESPACE_BEGIN
41
42 class ContentLanguageListRep;
43 a.dunfey 1.1.2.2
44 //////////////////////////////////////////////////////////////
45 //
46 // ContentLanguageList
47 //
48 //////////////////////////////////////////////////////////////
49
50 /** <I><B>Experimental Interface</B></I><BR>
51 This class represents a list of content languages (such as may appear
52 in an HTTP Content-Language header value). It is managed as a list of
53 LanguageTag objects.
54 */
55 class PEGASUS_COMMON_LINKAGE ContentLanguageList
56 {
57 public:
58
59 /**
60 Constructs an empty ContentLanguageList object.
61 */
62 ContentLanguageList();
63
64 a.dunfey 1.1.2.2 /**
65 Copy constructor.
66 @param contentLanguages The ContentLanguageList object to copy.
67 */
68 ContentLanguageList(const ContentLanguageList& contentLanguages);
69
70 /**
71 Destructor.
72 */
73 ~ContentLanguageList();
74
75 /**
76 Assignment operator.
77 @param contentLanguages The ContentLanguageList object to copy.
78 */
79 ContentLanguageList& operator=(const ContentLanguageList& contentLanguages);
80
81 /**
82 Returns the number of LanguageTags in the ContentLanguageList object.
83 @return Integer size of the ContentLanguageList list.
84 */
85 a.dunfey 1.1.2.2 Uint32 size() const;
86
87 /**
88 Accesses a LanguageTag at a specified index.
89 @param index Integer index of the LanguageTag to access.
90 Valid indices range from 0 to size()-1.
91 @return The LanguageTag corresponding to the specified index.
92 @exception IndexOutOfBoundsException If the specified index is out of
93 range.
94 */
95 LanguageTag getLanguageTag(Uint32 index) const;
96
97 /**
98 Appends a LanguageTag to the ContentLanguageList object.
99 @param languageTag The LanguageTag to append.
100 */
101 void append(const LanguageTag& languageTag);
102
103 /**
104 Removes the specified LanguageTag from the ContentLanguageList object.
105 @param index Integer index of the LanguageTag to remove.
106 a.dunfey 1.1.2.2 @exception IndexOutOfBoundsException If the specified index is out of
107 range.
108 */
109 void remove(Uint32 index);
110
111 /**
112 Finds the specified LanguageTag in the ContentLanguageList object and
113 returns its index.
114 @param languageTag The LanguageTag to find.
115 @return Integer index of the LanguageTag, if found; otherwise
116 PEG_NOT_FOUND.
117 */
118 Uint32 find(const LanguageTag& languageTag) const;
119
120 /**
121 Removes all the LanguageTags from the ContentLanguageList object.
122 */
123 void clear();
124
125 /**
126 Tests ContentLanguageList objects for equality.
127 a.dunfey 1.1.2.2 @param contentLanguages A ContentLanguageList object to be compared.
128 @return True if the ContentLanguageList objects contain the same
129 LanguageTags in the same order, false otherwise.
130 */
131 Boolean operator==(const ContentLanguageList& contentLanguages) const;
132
133 /**
134 Tests ContentLanguageList objects for inequality.
135 @param contentLanguages A ContentLanguageList object to be compared.
136 @return False if the ContentLanguageList objects contain the same
137 LanguageTags in the same order, true otherwise.
138 */
139 Boolean operator!=(const ContentLanguageList& contentLanguages) const;
140
141 private:
142 ContentLanguageListRep *_rep;
143 };
144
145 PEGASUS_NAMESPACE_END
146
147 #endif // PEGASUS_USE_EXPERIMENTAL_INTERFACES
148 a.dunfey 1.1.2.2
149 #endif
|