Changeset 7607 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Mar 27, 2008 9:33:38 PM (17 years ago)
- Location:
- trunk/src/VBox/Main/xml
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/SchemaDefs.xsl
r7466 r7607 10 10 11 11 Copyright (C) 2006-2007 innotek GmbH 12 12 13 13 This file is part of VirtualBox Open Source Edition (OSE), as 14 14 available from http://www.virtualbox.org. This file is free software; … … 28 28 <xsl:strip-space elements="*"/> 29 29 30 <xsl:param name="mode" expr=''/> 31 30 32 <!-- 31 33 // helpers … … 54 56 --> 55 57 <xsl:template match="*"/> 56 57 < !--58 * header 59 --> 58 <xsl:template match="*" mode="declare"/> 59 <xsl:template match="*" mode="declare.enum"/> 60 <xsl:template match="*" mode="define"/> 61 60 62 <xsl:template match="/"> 63 <xsl:choose> 64 <xsl:when test="$mode='declare'"> 65 <xsl:apply-templates select="/" mode="declare"/> 66 </xsl:when> 67 <xsl:when test="$mode='define'"> 68 <xsl:apply-templates select="/" mode="define"/> 69 </xsl:when> 70 <xsl:otherwise> 71 <xsl:message terminate="yes"> 72 Value '<xsl:value-of select="$mode"/>' of parameter 'mode' is invalid! 73 </xsl:message> 74 </xsl:otherwise> 75 </xsl:choose> 76 </xsl:template> 77 78 <!-- 79 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 80 * declare mode (C++ header file) 81 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 82 --> 83 84 <xsl:template match="/" mode="declare"> 61 85 <xsl:text> 62 86 /* 63 87 * DO NOT EDIT. 64 88 * 65 * This header is automatically generated from the VirtualBox XML S chema66 * and contains selected schema constraints defined in C.89 * This header is automatically generated from the VirtualBox XML Settings 90 * Schema and contains selected schema constraints declared in C++. 67 91 */ 68 92 … … 70 94 #define ____H_SCHEMADEFS 71 95 72 structSchemaDefs96 namespace SchemaDefs 73 97 { 74 98 enum … … 76 100 </xsl:text> 77 101 78 <xsl:apply-templates select="xsd:schema" />102 <xsl:apply-templates select="xsd:schema" mode="declare.enum"/> 79 103 80 104 <xsl:text> }; 81 }; 105 </xsl:text> 106 107 <xsl:apply-templates select="xsd:schema" mode="declare"/> 108 109 <xsl:text>} 82 110 83 111 #endif // ____H_SCHEMADEFS … … 86 114 87 115 <!-- 88 * e xtract schema definitions89 --> 90 <xsl:template match="xsd:schema" >116 * enumeration values 117 --> 118 <xsl:template match="xsd:schema" mode="declare.enum"> 91 119 92 120 <!-- process include statements --> … … 94 122 <!-- skip VirtualBox-settings-root.xsd inclusion as it is computed at runtime --> 95 123 <xsl:if test="not(@schemaLocation='VirtualBox-settings-root.xsd')"> 96 <xsl:apply-templates select="document(@schemaLocation)/xsd:schema" />124 <xsl:apply-templates select="document(@schemaLocation)/xsd:schema" mode="declare.enum"/> 97 125 </xsl:if> 98 126 </xsl:for-each> … … 123 151 "/> 124 152 </xsl:call-template> 153 125 154 <xsl:call-template name="defineEnumMember"> 126 155 <xsl:with-param name="member" select="' MaxGuestMonitors'"/> … … 135 164 "/> 136 165 </xsl:call-template> 166 137 167 <xsl:call-template name="defineEnumMember"> 138 168 <xsl:with-param name="member" select="' SerialPortCount'"/> … … 141 171 "/> 142 172 </xsl:call-template> 173 143 174 <xsl:call-template name="defineEnumMember"> 144 175 <xsl:with-param name="member" select="' ParallelPortCount'"/> … … 147 178 "/> 148 179 </xsl:call-template> 180 149 181 <xsl:call-template name="defineEnumMember"> 150 182 <xsl:with-param name="member" select="' MaxBootPosition'"/> … … 156 188 </xsl:template> 157 189 190 <!-- 191 * aliases (defines) for individual OSTypeIds array elements 192 --> 193 <xsl:template match="xsd:schema" mode="declare"> 194 195 <xsl:text>
 extern const char *OSTypeIds[];
</xsl:text> 196 197 <xsl:text>
 enum { OSTypeId_COUNT = </xsl:text> 198 <xsl:value-of select="count ( 199 xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration | 200 document(xsd:include[not(@schemaLocation='VirtualBox-settings-root.xsd')]/@schemaLocation)/xsd:schema/xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration 201 )"/> 202 <xsl:text> };

</xsl:text> 203 204 <xsl:for-each select=" 205 xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration | 206 document(xsd:include[not(@schemaLocation='VirtualBox-settings-root.xsd')]/@schemaLocation)/xsd:schema/xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration 207 "> 208 <xsl:text> #define SchemaDefs_OSTypeId_</xsl:text> 209 <xsl:value-of select="@value"/> 210 <xsl:text> SchemaDefs::OSTypeIds [</xsl:text> 211 <xsl:value-of select="position()-1"/> 212 <xsl:text>]
</xsl:text> 213 </xsl:for-each> 214 215 </xsl:template> 216 217 <!-- 218 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 219 * define mode (C++ source file) 220 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 221 --> 222 223 <xsl:template match="/" mode="define"> 224 <xsl:text> 225 /* 226 * DO NOT EDIT. 227 * 228 * This source is automatically generated from the VirtualBox XML Settings 229 * Schema and contains selected schema constraints defined in C++. 230 */ 231 232 #include "SchemaDefs.h" 233 234 namespace SchemaDefs 235 { 236 </xsl:text> 237 238 <xsl:apply-templates select="xsd:schema" mode="define"/> 239 240 <xsl:text>} 241 </xsl:text> 242 </xsl:template> 243 244 <!-- 245 * array of OSTypeIds 246 --> 247 <xsl:template match="xsd:schema" mode="define"> 248 <xsl:text> const char *OSTypeIds[] = 249 { 250 </xsl:text> 251 <xsl:for-each select=" 252 xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration | 253 document(xsd:include[not(@schemaLocation='VirtualBox-settings-root.xsd')]/@schemaLocation)/xsd:schema/xsd:simpleType[@name='TGuestOSType']/xsd:restriction[@base='xsd:string']/xsd:enumeration 254 "> 255 <xsl:text> "</xsl:text> 256 <xsl:value-of select="@value"/> 257 <xsl:text>", 258 </xsl:text> 259 </xsl:for-each> 260 <xsl:text> }; 261 </xsl:text> 262 </xsl:template> 263 264 <!-- 265 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 266 * END 267 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 268 --> 269 158 270 </xsl:stylesheet> -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r7556 r7607 131 131 <xsd:simpleType name="TGuestOSType"> 132 132 <xsd:restriction base="xsd:string"> 133 <!-- @todo on next format change, rename dos to DOS, win2k3 to Win2003 and 134 so on. Possibly also use prefixes that determine the platform family: 135 Win_31, Win_Vista, Linux_ArchLinux, Unix_FreeBSD and so on. --> 133 136 <xsd:enumeration value="unknown"/> 134 137 <xsd:enumeration value="dos"/> … … 142 145 <xsd:enumeration value="win2k3"/> 143 146 <xsd:enumeration value="winvista"/> 147 <xsd:enumeration value="win2k8"/> 144 148 <xsd:enumeration value="os2warp3"/> 145 149 <xsd:enumeration value="os2warp4"/> 146 150 <xsd:enumeration value="os2warp45"/> 151 <xsd:enumeration value="ecs"/> 147 152 <xsd:enumeration value="linux22"/> 148 153 <xsd:enumeration value="linux24"/> 149 154 <xsd:enumeration value="linux26"/> 155 <xsd:enumeration value="archlinux"/> 156 <xsd:enumeration value="debian"/> 157 <xsd:enumeration value="opensuse"/> 158 <xsd:enumeration value="fedoracore"/> 159 <xsd:enumeration value="gentoo"/> 160 <xsd:enumeration value="mandriva"/> 161 <xsd:enumeration value="redhat"/> 162 <xsd:enumeration value="ubuntu"/> 163 <xsd:enumeration value="xandros"/> 150 164 <xsd:enumeration value="freebsd"/> 151 165 <xsd:enumeration value="openbsd"/> … … 182 196 183 197 <xsd:simpleType name="TBIOSBootMenuModeType"> 184 185 186 187 188 198 <xsd:restriction base="xsd:string"> 199 <xsd:enumeration value="Disabled"/> 200 <xsd:enumeration value="MenuOnly"/> 201 <xsd:enumeration value="MessageAndMenu"/> 202 </xsd:restriction> 189 203 </xsd:simpleType> 190 204 … … 197 211 198 212 <xsd:simpleType name="TClipboardMode"> 199 200 201 202 203 204 213 <xsd:restriction base="xsd:string"> 214 <xsd:enumeration value="Disabled"/> 215 <xsd:enumeration value="HostToGuest"/> 216 <xsd:enumeration value="GuestToHost"/> 217 <xsd:enumeration value="Bidirectional"/> 218 </xsd:restriction> 205 219 </xsd:simpleType> 206 220 207 221 <xsd:simpleType name="TPortMode"> 208 209 210 211 212 222 <xsd:restriction base="xsd:string"> 223 <xsd:enumeration value="Disconnected"/> 224 <xsd:enumeration value="HostPipe"/> 225 <xsd:enumeration value="HostDevice"/> 226 </xsd:restriction> 213 227 </xsd:simpleType> 214 228
Note:
See TracChangeset
for help on using the changeset viewer.