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
00111
00112
00113
00114
00115
00116
00117
00118
00119 #if !defined(ATTDEF_HPP)
00120 #define ATTDEF_HPP
00121
00122 #include <xercesc/util/XMLString.hpp>
00123
00124 XERCES_CPP_NAMESPACE_BEGIN
00125
00126 class XMLAttr;
00127
00146 class XMLAttDef
00147 {
00148 public:
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165 enum AttTypes
00166 {
00167 CData = 0
00168 , ID = 1
00169 , IDRef = 2
00170 , IDRefs = 3
00171 , Entity = 4
00172 , Entities = 5
00173 , NmToken = 6
00174 , NmTokens = 7
00175 , Notation = 8
00176 , Enumeration = 9
00177 , Simple = 10
00178 , Any_Any = 11
00179 , Any_Other = 12
00180 , Any_List = 13
00181
00182 , AttTypes_Count
00183 , AttTypes_Min = 0
00184 , AttTypes_Max = 13
00185 , AttTypes_Unknown = -1
00186 };
00187
00188 enum DefAttTypes
00189 {
00190 Default = 0
00191 , Fixed = 1
00192 , Required = 2
00193 , Required_And_Fixed = 3
00194 , Implied = 4
00195 , ProcessContents_Skip = 5
00196 , ProcessContents_Lax = 6
00197 , ProcessContents_Strict = 7
00198 , Prohibited = 8
00199
00200 , DefAttTypes_Count
00201 , DefAttTypes_Min = 0
00202 , DefAttTypes_Max = 8
00203 , DefAttTypes_Unknown = -1
00204 };
00205
00206 enum CreateReasons
00207 {
00208 NoReason
00209 , JustFaultIn
00210 };
00211
00212
00213
00214
00215 static const unsigned int fgInvalidAttrId;
00216
00217
00218
00219
00220
00221
00224
00235 static const XMLCh* getAttTypeString(const AttTypes attrType);
00236
00247 static const XMLCh* getDefAttTypeString(const DefAttTypes attrType);
00248
00250
00251
00252
00253
00254
00255
00258
00262 virtual ~XMLAttDef();
00264
00265
00266
00267
00268
00269
00272
00281 virtual const XMLCh* getFullName() const = 0;
00282
00287 virtual void reset() = 0;
00288
00290
00291
00292
00293
00294
00295
00298
00307 DefAttTypes getDefaultType() const;
00308
00318 const XMLCh* getEnumeration() const;
00319
00328 unsigned int getId() const;
00329
00343 bool getProvided() const;
00344
00354 AttTypes getType() const;
00355
00365 const XMLCh* getValue() const;
00366
00375 CreateReasons getCreateReason() const;
00376
00384 bool isExternal() const;
00385
00386
00390 virtual const XMLCh* getDOMTypeInfoUri() const = 0;
00391
00395 virtual const XMLCh* getDOMTypeInfoName() const = 0;
00396
00398
00399
00400
00401
00402
00403
00406
00415 void setDefaultType(const XMLAttDef::DefAttTypes newValue);
00416
00425 void setId(const unsigned int newId);
00426
00435 void setProvided(const bool newValue);
00436
00444 void setType(const XMLAttDef::AttTypes newValue);
00445
00456 void setValue(const XMLCh* const newValue);
00457
00468 void setEnumeration(const XMLCh* const newValue);
00469
00477 void setCreateReason(const CreateReasons newReason);
00478
00484 void setExternalAttDeclaration(const bool aValue);
00485
00487
00488 protected :
00489
00490
00491
00492 XMLAttDef
00493 (
00494 const AttTypes type = CData
00495 , const DefAttTypes defType = Implied
00496 );
00497 XMLAttDef
00498 (
00499 const XMLCh* const attValue
00500 , const AttTypes type
00501 , const DefAttTypes defType
00502 , const XMLCh* const enumValues = 0
00503 );
00504
00505
00506 private :
00507
00508
00509
00510 XMLAttDef(const XMLAttDef&);
00511 void operator=(const XMLAttDef&);
00512
00513
00514
00515
00516
00517 void cleanUp();
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556 DefAttTypes fDefaultType;
00557 XMLCh* fEnumeration;
00558 unsigned int fId;
00559 bool fProvided;
00560 AttTypes fType;
00561 XMLCh* fValue;
00562 CreateReasons fCreateReason;
00563 bool fExternalAttribute;
00564 };
00565
00566
00567
00568
00569
00570
00571 inline XMLAttDef::DefAttTypes XMLAttDef::getDefaultType() const
00572 {
00573 return fDefaultType;
00574 }
00575
00576 inline const XMLCh* XMLAttDef::getEnumeration() const
00577 {
00578 return fEnumeration;
00579 }
00580
00581 inline unsigned int XMLAttDef::getId() const
00582 {
00583 return fId;
00584 }
00585
00586 inline bool XMLAttDef::getProvided() const
00587 {
00588 return fProvided;
00589 }
00590
00591 inline XMLAttDef::AttTypes XMLAttDef::getType() const
00592 {
00593 return fType;
00594 }
00595
00596 inline const XMLCh* XMLAttDef::getValue() const
00597 {
00598 return fValue;
00599 }
00600
00601 inline XMLAttDef::CreateReasons XMLAttDef::getCreateReason() const
00602 {
00603 return fCreateReason;
00604 }
00605
00606 inline bool XMLAttDef::isExternal() const
00607 {
00608 return fExternalAttribute;
00609 }
00610
00611
00612
00613
00614
00615 inline void XMLAttDef::setDefaultType(const XMLAttDef::DefAttTypes newValue)
00616 {
00617 fDefaultType = newValue;
00618 }
00619
00620 inline void XMLAttDef::setEnumeration(const XMLCh* const newValue)
00621 {
00622 delete [] fEnumeration;
00623
00624 if (newValue) {
00625 fEnumeration = XMLString::replicate(newValue);
00626 }
00627 else {
00628 fEnumeration = 0;
00629 }
00630 }
00631
00632 inline void XMLAttDef::setId(const unsigned int newId)
00633 {
00634 fId = newId;
00635 }
00636
00637 inline void XMLAttDef::setProvided(const bool newValue)
00638 {
00639 fProvided = newValue;
00640 }
00641
00642 inline void XMLAttDef::setType(const XMLAttDef::AttTypes newValue)
00643 {
00644 fType = newValue;
00645 }
00646
00647 inline void XMLAttDef::setValue(const XMLCh* const newValue)
00648 {
00649 delete [] fValue;
00650 fValue = XMLString::replicate(newValue);
00651 }
00652
00653 inline void
00654 XMLAttDef::setCreateReason(const XMLAttDef::CreateReasons newReason)
00655 {
00656 fCreateReason = newReason;
00657 }
00658
00659 inline void XMLAttDef::setExternalAttDeclaration(const bool aValue)
00660 {
00661 fExternalAttribute = aValue;
00662 }
00663
00664 XERCES_CPP_NAMESPACE_END
00665
00666 #endif