00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110 #if !defined(ATTDEF_HPP)
00111 #define ATTDEF_HPP
00112
00113 #include <xercesc/util/XMLString.hpp>
00114
00115 class XMLAttr;
00116
00135 class XMLAttDef
00136 {
00137 public:
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154 enum AttTypes
00155 {
00156 CData = 0
00157 , ID = 1
00158 , IDRef = 2
00159 , IDRefs = 3
00160 , Entity = 4
00161 , Entities = 5
00162 , NmToken = 6
00163 , NmTokens = 7
00164 , Notation = 8
00165 , Enumeration = 9
00166 , Simple = 10
00167 , Any_Any = 11
00168 , Any_Other = 12
00169 , Any_List = 13
00170
00171 , AttTypes_Count
00172 , AttTypes_Min = 0
00173 , AttTypes_Max = 13
00174 , AttTypes_Unknown = -1
00175 };
00176
00177 enum DefAttTypes
00178 {
00179 Default = 0
00180 , Fixed = 1
00181 , Required = 2
00182 , Required_And_Fixed = 3
00183 , Implied = 4
00184 , ProcessContents_Strict = 5
00185 , ProcessContents_Lax = 6
00186 , ProcessContents_Skip = 7
00187 , Prohibited = 8
00188
00189 , DefAttTypes_Count
00190 , DefAttTypes_Min = 0
00191 , DefAttTypes_Max = 8
00192 , DefAttTypes_Unknown = -1
00193 };
00194
00195 enum CreateReasons
00196 {
00197 NoReason
00198 , JustFaultIn
00199 };
00200
00201
00202
00203
00204 static const unsigned int fgInvalidAttrId;
00205
00206
00207
00208
00209
00210
00213
00224 static const XMLCh* getAttTypeString(const AttTypes attrType);
00225
00236 static const XMLCh* getDefAttTypeString(const DefAttTypes attrType);
00237
00239
00240
00241
00242
00243
00244
00247
00251 virtual ~XMLAttDef();
00253
00254
00255
00256
00257
00258
00261
00270 virtual const XMLCh* getFullName() const = 0;
00271
00273
00274
00275
00276
00277
00278
00281
00290 DefAttTypes getDefaultType() const;
00291
00301 const XMLCh* getEnumeration() const;
00302
00311 unsigned int getId() const;
00312
00326 bool getProvided() const;
00327
00337 AttTypes getType() const;
00338
00348 const XMLCh* getValue() const;
00349
00358 CreateReasons getCreateReason() const;
00359
00367 bool isExternal() const;
00368
00370
00371
00372
00373
00374
00375
00378
00387 void setDefaultType(const XMLAttDef::DefAttTypes newValue);
00388
00397 void setId(const unsigned int newId);
00398
00407 void setProvided(const bool newValue);
00408
00416 void setType(const XMLAttDef::AttTypes newValue);
00417
00428 void setValue(const XMLCh* const newValue);
00429
00440 void setEnumeration(const XMLCh* const newValue);
00441
00449 void setCreateReason(const CreateReasons newReason);
00450
00456 void setExternalAttDeclaration(const bool aValue);
00457
00459
00460 protected :
00461
00462
00463
00464 XMLAttDef
00465 (
00466 const AttTypes type = CData
00467 , const DefAttTypes defType = Implied
00468 );
00469 XMLAttDef
00470 (
00471 const XMLCh* const attValue
00472 , const AttTypes type
00473 , const DefAttTypes defType
00474 , const XMLCh* const enumValues = 0
00475 );
00476
00477
00478 private :
00479
00480
00481
00482 XMLAttDef(const XMLAttDef&);
00483 void operator=(const XMLAttDef&);
00484
00485
00486
00487
00488
00489 void cleanUp();
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528 DefAttTypes fDefaultType;
00529 XMLCh* fEnumeration;
00530 unsigned int fId;
00531 bool fProvided;
00532 AttTypes fType;
00533 XMLCh* fValue;
00534 CreateReasons fCreateReason;
00535 bool fExternalAttribute;
00536 };
00537
00538
00539
00540
00541
00542
00543 inline XMLAttDef::DefAttTypes XMLAttDef::getDefaultType() const
00544 {
00545 return fDefaultType;
00546 }
00547
00548 inline const XMLCh* XMLAttDef::getEnumeration() const
00549 {
00550 return fEnumeration;
00551 }
00552
00553 inline unsigned int XMLAttDef::getId() const
00554 {
00555 return fId;
00556 }
00557
00558 inline bool XMLAttDef::getProvided() const
00559 {
00560 return fProvided;
00561 }
00562
00563 inline XMLAttDef::AttTypes XMLAttDef::getType() const
00564 {
00565 return fType;
00566 }
00567
00568 inline const XMLCh* XMLAttDef::getValue() const
00569 {
00570 return fValue;
00571 }
00572
00573 inline XMLAttDef::CreateReasons XMLAttDef::getCreateReason() const
00574 {
00575 return fCreateReason;
00576 }
00577
00578 inline bool XMLAttDef::isExternal() const
00579 {
00580 return fExternalAttribute;
00581 }
00582
00583
00584
00585
00586
00587 inline void XMLAttDef::setDefaultType(const XMLAttDef::DefAttTypes newValue)
00588 {
00589 fDefaultType = newValue;
00590 }
00591
00592 inline void XMLAttDef::setEnumeration(const XMLCh* const newValue)
00593 {
00594 delete [] fEnumeration;
00595
00596 if (newValue) {
00597 fEnumeration = XMLString::replicate(newValue);
00598 }
00599 else {
00600 fEnumeration = 0;
00601 }
00602 }
00603
00604 inline void XMLAttDef::setId(const unsigned int newId)
00605 {
00606 fId = newId;
00607 }
00608
00609 inline void XMLAttDef::setProvided(const bool newValue)
00610 {
00611 fProvided = newValue;
00612 }
00613
00614 inline void XMLAttDef::setType(const XMLAttDef::AttTypes newValue)
00615 {
00616 fType = newValue;
00617 }
00618
00619 inline void XMLAttDef::setValue(const XMLCh* const newValue)
00620 {
00621 delete [] fValue;
00622 fValue = XMLString::replicate(newValue);
00623 }
00624
00625 inline void
00626 XMLAttDef::setCreateReason(const XMLAttDef::CreateReasons newReason)
00627 {
00628 fCreateReason = newReason;
00629 }
00630
00631 inline void XMLAttDef::setExternalAttDeclaration(const bool aValue)
00632 {
00633 fExternalAttribute = aValue;
00634 }
00635
00636 #endif