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