1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
|
/******************************************************************************
* Copyright (c) 2000-2021 Ericsson Telecom AB
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* Contributors:
* Szabo, Bence Janos
*
******************************************************************************/
#include "XSD_Types.hh"
#include <cstddef>
#include "error.h"
// Used in the code generation of the xer descriptor, and the union generation
const char * XSD_type_to_string(const XSD_types xsd_type) {
switch (xsd_type) {
case XSD_NONE:
return "XSD_NONE";
case XSD_ANYSIMPLETYPE:
return "XSD_ANYSIMPLETYPE";
case XSD_ANYTYPE:
return "XSD_ANYTYPE";
case XSD_STRING:
return "XSD_STRING";
case XSD_NORMALIZEDSTRING:
return "XSD_NORMALIZEDSTRING";
case XSD_TOKEN:
return "XSD_TOKEN";
case XSD_NAME:
return "XSD_NAME";
case XSD_NMTOKEN:
return "XSD_NMTOKEN";
case XSD_NCName:
return "XSD_NCName";
case XSD_ID:
return "XSD_ID";
case XSD_IDREF:
return "XSD_IDREF";
case XSD_ENTITY:
return "XSD_ENTITY";
case XSD_HEXBINARY:
return "XSD_HEXBINARY";
case XSD_BASE64BINARY:
return "XSD_BASE64BINARY";
case XSD_ANYURI:
return "XSD_ANYURI";
case XSD_LANGUAGE:
return "XSD_LANGUAGE";
case XSD_INTEGER:
return "XSD_INTEGER";
case XSD_POSITIVEINTEGER:
return "XSD_POSITIVEINTEGER";
case XSD_NONPOSITIVEINTEGER:
return "XSD_NONPOSITIVEINTEGER";
case XSD_NEGATIVEINTEGER:
return "XSD_NEGATIVEINTEGER";
case XSD_NONNEGATIVEINTEGER:
return "XSD_NONNEGATIVEINTEGER";
case XSD_LONG:
return "XSD_LONG";
case XSD_UNSIGNEDLONG:
return "XSD_UNSIGNEDLONG";
case XSD_INT:
return "XSD_INT";
case XSD_UNSIGNEDINT:
return "XSD_UNSIGNEDINT";
case XSD_SHORT:
return "XSD_SHORT";
case XSD_UNSIGNEDSHORT:
return "XSD_UNSIGNEDSHORT";
case XSD_BYTE:
return "XSD_BYTE";
case XSD_UNSIGNEDBYTE:
return "XSD_UNSIGNEDBYTE";
case XSD_DECIMAL:
return "XSD_DECIMAL";
case XSD_FLOAT:
return "XSD_FLOAT";
case XSD_DOUBLE:
return "XSD_DOUBLE";
case XSD_DURATION:
return "XSD_DURATION";
case XSD_DATETIME:
return "XSD_DATETIME";
case XSD_TIME:
return "XSD_TIME";
case XSD_DATE:
return "XSD_DATE";
case XSD_GYEARMONTH:
return "XSD_GYEARMONTH";
case XSD_GYEAR:
return "XSD_GYEAR";
case XSD_GMONTHDAY:
return "XSD_GMONTHDAY";
case XSD_GDAY:
return "XSD_GDAY";
case XSD_GMONTH:
return "XSD_GMONTH";
case XSD_NMTOKENS:
return "XSD_NMTOKENS";
case XSD_IDREFS:
return "XSD_IDREFS";
case XSD_ENTITIES:
return "XSD_ENTITIES";
case XSD_QNAME:
return "XSD_QNAME";
case XSD_BOOLEAN:
return "XSD_BOOLEAN";
default:
FATAL_ERROR("XSD_Types::XSD_type_to_string - invalid XSD type");
return NULL;
}
}
// Used in the union XER encoder and decoder code generation
const char * XSD_type_to_xml_type(const XSD_types xsd_type) {
switch (xsd_type) {
case XSD_NONE:
return "";
case XSD_ANYSIMPLETYPE:
return "anySimpleType";
case XSD_ANYTYPE:
return "anyType";
case XSD_STRING:
return "string";
case XSD_NORMALIZEDSTRING:
return "normalizedString";
case XSD_TOKEN:
return "token";
case XSD_NAME:
return "Name";
case XSD_NMTOKEN:
return "NMTOKEN";
case XSD_NCName:
return "NCName";
case XSD_ID:
return "ID";
case XSD_IDREF:
return "IDREF";
case XSD_ENTITY:
return "ENTITY";
case XSD_HEXBINARY:
return "hexBinary";
case XSD_BASE64BINARY:
return "base64Binary";
case XSD_ANYURI:
return "anyURI";
case XSD_LANGUAGE:
return "language";
case XSD_INTEGER:
return "integer";
case XSD_POSITIVEINTEGER:
return "positiveInteger";
case XSD_NONPOSITIVEINTEGER:
return "nonPositiveInteger";
case XSD_NEGATIVEINTEGER:
return "negativeInteger";
case XSD_NONNEGATIVEINTEGER:
return "nonNegativeInteger";
case XSD_LONG:
return "long";
case XSD_UNSIGNEDLONG:
return "unsignedLong";
case XSD_INT:
return "int";
case XSD_UNSIGNEDINT:
return "unsignedInt";
case XSD_SHORT:
return "short";
case XSD_UNSIGNEDSHORT:
return "unsignedShort";
case XSD_BYTE:
return "byte";
case XSD_UNSIGNEDBYTE:
return "unsignedByte";
case XSD_DECIMAL:
return "decimal";
case XSD_FLOAT:
return "float";
case XSD_DOUBLE:
return "double";
case XSD_DURATION:
return "duration";
case XSD_DATETIME:
return "dateTime";
case XSD_TIME:
return "time";
case XSD_DATE:
return "date";
case XSD_GYEARMONTH:
return "gYearMonth";
case XSD_GYEAR:
return "gYear";
case XSD_GMONTHDAY:
return "gMonthDay";
case XSD_GDAY:
return "gDay";
case XSD_GMONTH:
return "gMonth";
case XSD_NMTOKENS:
return "NMTOKENS";
case XSD_IDREFS:
return "IDREFS";
case XSD_ENTITIES:
return "ENTITIES";
case XSD_QNAME:
return "QName";
case XSD_BOOLEAN:
return "boolean";
default:
FATAL_ERROR("XSD_Types::XSD_type_to_xml_type - invalid XSD type");
return NULL;
}
}
|