xref: /trunk/main/xml2cmp/source/x2cclass/xml_cd.hxx (revision dd7bc091)
1*dd7bc091SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*dd7bc091SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*dd7bc091SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*dd7bc091SAndrew Rist  * distributed with this work for additional information
6*dd7bc091SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*dd7bc091SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*dd7bc091SAndrew Rist  * "License"); you may not use this file except in compliance
9*dd7bc091SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*dd7bc091SAndrew Rist  *
11*dd7bc091SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*dd7bc091SAndrew Rist  *
13*dd7bc091SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*dd7bc091SAndrew Rist  * software distributed under the License is distributed on an
15*dd7bc091SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*dd7bc091SAndrew Rist  * KIND, either express or implied.  See the License for the
17*dd7bc091SAndrew Rist  * specific language governing permissions and limitations
18*dd7bc091SAndrew Rist  * under the License.
19*dd7bc091SAndrew Rist  *
20*dd7bc091SAndrew Rist  *************************************************************/
21*dd7bc091SAndrew Rist 
22*dd7bc091SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef	UDKSERVICE_XML_CD_HXX
25cdf0e10cSrcweir #define	UDKSERVICE_XML_CD_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <tools/string.hxx>
29cdf0e10cSrcweir #include "x2cstl.hxx"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir 
32cdf0e10cSrcweir 
33cdf0e10cSrcweir /**	Represents one Component description from an XML file.
34cdf0e10cSrcweir 	DatumOf() is used for tags with only one value.
35cdf0e10cSrcweir 	DataOf() is used, if the tag has multiple values or if
36cdf0e10cSrcweir 	you	don't know.
37cdf0e10cSrcweir **/
38cdf0e10cSrcweir class ComponentDescription
39cdf0e10cSrcweir {
40cdf0e10cSrcweir   public:
41cdf0e10cSrcweir 	/**	@ATTENTION
42cdf0e10cSrcweir 		Because the enum values are used as array indices:
43cdf0e10cSrcweir 			tag_None must be the first and have the value "0".
44cdf0e10cSrcweir 			tag_MAX must be the last.
45cdf0e10cSrcweir 			The enum values must not be assigned numbers.
46cdf0e10cSrcweir 	**/
47cdf0e10cSrcweir 	enum E_Tag
48cdf0e10cSrcweir 	{
49cdf0e10cSrcweir 		tag_None = 0,
50cdf0e10cSrcweir 		tag_Name,
51cdf0e10cSrcweir 		tag_Description,
52cdf0e10cSrcweir 		tag_ModuleName,
53cdf0e10cSrcweir 		tag_LoaderName,
54cdf0e10cSrcweir 		tag_SupportedService,
55cdf0e10cSrcweir 		tag_ProjectBuildDependency,
56cdf0e10cSrcweir 		tag_RuntimeModuleDependency,
57cdf0e10cSrcweir 		tag_ServiceDependency,
58cdf0e10cSrcweir 		tag_Language,
59cdf0e10cSrcweir 		tag_Status,
60cdf0e10cSrcweir 		tag_Type,
61cdf0e10cSrcweir 		tag_MAX
62cdf0e10cSrcweir 	};
63cdf0e10cSrcweir 
~ComponentDescription()64cdf0e10cSrcweir 	virtual				~ComponentDescription() {}
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	/// @return All values of this tag. An empty vector for wrong indices.
67cdf0e10cSrcweir 	virtual const std::vector< ByteString > &
68cdf0e10cSrcweir 						DataOf(
69cdf0e10cSrcweir 							ComponentDescription::E_Tag
70cdf0e10cSrcweir 													i_eTag ) const = 0;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	/// @return The only or the first value of this tag. An empty string for wrong indices.
73cdf0e10cSrcweir 	virtual ByteString 	DatumOf(
74cdf0e10cSrcweir 							ComponentDescription::E_Tag
75cdf0e10cSrcweir 													i_eTag ) const = 0;
76cdf0e10cSrcweir };
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 
79cdf0e10cSrcweir #endif
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 
82