1 chuck 1.1 //%/////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM,
4 // The Open Group, Tivoli Systems
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to
8 // deal in the Software without restriction, including without limitation the
9 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 // sell copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
14 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
15 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
16 // LIMITED TO THEa
17 // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
18 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 chuck 1.1 //
23 //==============================================================================
24 //
25 // Author: Humberto Rivero (hurivero@us.ibm.com)
26 //
27 // Modified By:
28 //
29 //%/////////////////////////////////////////////////////////////////////////////
30
31 #ifndef Pegasus_LanguageElement_h
32 #define Pegasus_LanguageElement_h
33
34 #include <cstdlib>
35 #include <cctype>
36 #include <iostream>
|
38 chuck 1.1 #include <Pegasus/Common/Linkage.h>
39 #include <Pegasus/Common/Config.h>
40 #include <Pegasus/Common/String.h>
41 #include <Pegasus/Common/Array.h>
42
43
44 PEGASUS_NAMESPACE_BEGIN
45
46 //////////////////////////////////////////////////////////////
47 //
48 // LanguageElement::
49 //
50 //////////////////////////////////////////////////////////////
51
52 /** This is a base class for derived LanguageElements
53 */
54 class PEGASUS_COMMON_LINKAGE LanguageElement{
55
56 public:
57
58 /** This member is used to represent an empty LanguageElement. Using this
59 chuck 1.1 member avoids construction of an empty LanguageElement
60 (e.g., LanguageElement()).
61 */
62 static const LanguageElement EMPTY;
63
64 /**
65 * This member is used to notify callers of (Accept/Content)Languages::itrNext() that the end of the container
66 * has been reached and subsequent calls to (Accept/Content)Languages::itrNext() will fail.
67 */
68 static LanguageElement EMPTY_REF;
69
70 /** Constructor
71 */
72 LanguageElement();
73
74
75 /**
76 * Constructor
77 * @param language String - language ex: en
78 * @param country String - country code ex: US
79 * @param variant String - variant ex: rab-oof
80 chuck 1.1 * @param quality Real32 - quality associated with the language, defaults to 1.0
81 */
|
86 chuck 1.1 /**
87 * Constructor
88 * @param language_tag String language value
89 * @param quality Real32 quality associated with the language value, defaults to 1
90 */
91 LanguageElement(String language_tag, Real32 quality = 1);
92
93 /** Copy Constructor
94 */
95 LanguageElement(const LanguageElement &rhs);
96
97 /**
98 * Destructor
99 */
100 virtual ~LanguageElement();
101
102 /**
103 * Assignment operator, deep copy
104 */
|