(file) Return to ContentLanguages.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 karl  1.12 //%2005////////////////////////////////////////////////////////////////////////
  2 humberto 1.5  //
  3 karl     1.11 // 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 karl     1.7  // IBM Corp.; EMC Corporation, The Open Group.
  7 karl     1.11 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8               // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9 karl     1.12 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10               // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 humberto 1.5  //
 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 karl     1.7  // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 23 humberto 1.5  // 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_ContentLanguages_h
 33               #define Pegasus_ContentLanguages_h
 34               #include <Pegasus/Common/Config.h>
 35               #include <Pegasus/Common/LanguageElementContainer.h>
 36               #include <Pegasus/Common/ContentLanguageElement.h>
 37 chuck    1.6  #ifdef PEGASUS_USE_EXPERIMENTAL_INTERFACES
 38               
 39 humberto 1.5  PEGASUS_NAMESPACE_BEGIN
 40               
 41 humberto 1.8  class ContentLanguagesRep;
 42               
 43 humberto 1.5  //////////////////////////////////////////////////////////////
 44               //
 45               // ContentLanguages::
 46               //
 47               //////////////////////////////////////////////////////////////
 48               
 49 denise.eckstein 1.10 /** <I><B>Experimental Interface</B></I><BR>
 50                       */
 51 humberto        1.5  class PEGASUS_COMMON_LINKAGE ContentLanguages : public LanguageElementContainer{
 52                      
 53                      public:
 54                      
 55                      	/**	This member is used to represent an empty ContentLanguages. Using this 
 56                              member avoids construction of an empty ContentLanguages 
 57                              (e.g., ContentLanguages()).
 58                          */
 59                          static const ContentLanguages EMPTY;
 60                      
 61                      	/**
 62                      	 * Constructor
 63                      	 */
 64 humberto        1.8  	ContentLanguages();
 65 humberto        1.5  
 66                      	/**
 67                      	 * Constructor
 68                      	 * @param hdr String - ContentLanguage header
 69                      	 */
 70                      	ContentLanguages(String hdr); 
 71                      
 72                      	/**
 73                      	 * Constructor
 74                      	 * @param container Array<LanguageElement> - elements to construct the object with
 75                      	 */
 76 humberto        1.8  	ContentLanguages(const Array<LanguageElement> &container);
 77 humberto        1.5  	
 78                      	/**
 79                      	 * Constructor
 80                      	 * @param container Array<ContentLanguageElement> - elements to construct the object with
 81                      	 */
 82 humberto        1.8  	ContentLanguages(const Array<ContentLanguageElement> &container);
 83 humberto        1.5  
 84                      	/**
 85                      	 * Copy Constructor
 86                      	 * @param rhs ContentLanguages - element to construct the object with
 87                      	 */
 88                      	ContentLanguages(const ContentLanguages &rhs);
 89                      	
 90                      	/**
 91                      	 * Destructor
 92                      	 */
 93                      	~ContentLanguages();
 94                      	
 95                      	/**
 96                      	 * Random access into the container
 97                      	 * @param index int - position of element to get
 98                      	 * @return ContentLanguageElement element at postion index
 99                      	 * @throws IndexOutOfBounds Exception
100                      	 */
101 humberto        1.9  	ContentLanguageElement getLanguageElement(Uint32 index) const;
102 humberto        1.5  	
103                      	/**
104                      	 * Fills in the parameter array with all this objects elements
105                      	 * @param elements Array<ContentLanguageElement> & - filled with the contents of the ContentLanguages container 
106                      	 */
107                      	void getAllLanguageElements(Array<ContentLanguageElement> & elements) const;
108 humberto        1.8  
109                      	Array<ContentLanguageElement> getAllLanguageElements()const;
110                      
111                      
112 humberto        1.5  	
113                      	/**
114                      	 * Appends the element to the container
115                      	 * @param element ContentLanguageElement - element to append to container
116                      	 */
117                      	void append(ContentLanguageElement element);
118                      	
119                      	/**
120                      	 * Returns the next element in the container
121                      	 * Callers should call itrStart() ONCE before making calls to this function and
122                      	 * anytime the callers want the iterator reset to the beginning of the container.
123                      	 * @return ContentLanguageElement - the next element the container or ContentLanguageElement::EMPTY_REF
124                      	 * if the end of the container has been reached.
125                      	 */
126                      	ContentLanguageElement itrNext();
127                      	
128                      	/**
129                      	 * Finds the element in the container that matches the language_tag.
130                      	 * @param language_tag String - case insensitive match
131                      	 * @return int index of element if found, otherwise -1
132                      	 */
133 humberto        1.8  	Sint32 find(String language_tag)const;
134                      
135 humberto        1.5  	
136                      	/**
137                      	 * @return ostream - Returns a representation of this object in ContentLanguage header format
138                      	 * according to the RFC
139                      	 */
140 humberto        1.8  	PEGASUS_COMMON_LINKAGE friend PEGASUS_STD(ostream) & operator<<(PEGASUS_STD(ostream) &stream, const ContentLanguages &cl);
141 chuck           1.3  
142                      	/**
143                      	 * Assignment 
144                      	 * @param rhs ContentLanguages
145                      	 */
146 kumpf           1.13 	ContentLanguages& operator=(const ContentLanguages &rhs);
147 chuck           1.3  
148 humberto        1.8  	void buildLanguageElements(Array<String> values);
149 humberto        1.5  
150                      }; // end ContentLanguages
151                      
152                      PEGASUS_NAMESPACE_END
153 chuck           1.6  
154                      #endif  // PEGASUS_USE_EXPERIMENTAL_INTERFACES
155 humberto        1.5  
156                      #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2