00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef ACEXML_ATTRIBUTESIMPL_H
00015 #define ACEXML_ATTRIBUTESIMPL_H
00016
00017 #include "ace/pre.h"
00018 #include "ACEXML/common/ACEXML_Export.h"
00019
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 #pragma once
00022 #endif
00023
00024 #include "ACEXML/common/Attributes.h"
00025 #include "ace/Containers_T.h"
00026
00027 #if !defined ACEXML_AttributesImpl_Default_Size
00028 #define ACEXML_AttributesImpl_Default_Size 20
00029 #endif
00030
00031 class ACEXML_AttributesImpl;
00032
00033
00034
00035
00036
00037
00038
00039
00040 class ACEXML_Export ACEXML_Attribute
00041 {
00042 public:
00043 friend class ACEXML_AttributesImpl;
00044
00045
00046 ACEXML_Attribute (void);
00047
00048
00049 ACEXML_Attribute (const ACEXML_Attribute &attr);
00050
00051
00052 ACEXML_Attribute (const ACEXML_Char *uri,
00053 const ACEXML_Char *localName,
00054 const ACEXML_Char *qName,
00055 const ACEXML_Char *type,
00056 const ACEXML_Char *value);
00057
00058
00059 ~ACEXML_Attribute (void);
00060
00061
00062 void setAttribute (const ACEXML_Char *uri,
00063 const ACEXML_Char *localName,
00064 const ACEXML_Char *qName,
00065 const ACEXML_Char *type,
00066 const ACEXML_Char *value);
00067
00068
00069 const ACEXML_Char *uri (void) const;
00070
00071
00072 void uri (const ACEXML_Char *uri);
00073
00074
00075 const ACEXML_Char *localName (void) const;
00076
00077
00078 void localName (const ACEXML_Char *localName);
00079
00080
00081 const ACEXML_Char *qName (void) const;
00082
00083
00084 void qName (const ACEXML_Char *qName);
00085
00086
00087 const ACEXML_Char *type (void) const;
00088
00089
00090 void type (const ACEXML_Char *type);
00091
00092
00093 const ACEXML_Char *value (void) const;
00094
00095
00096 void value (const ACEXML_Char *value);
00097
00098
00099 ACEXML_Attribute &operator= (const ACEXML_Attribute &rhs);
00100
00101
00102 bool operator!= (const ACEXML_Attribute&rhs) const;
00103
00104 private:
00105
00106 ACEXML_Char *uri_;
00107
00108 ACEXML_Char *localName_;
00109 ACEXML_Char *qName_;
00110 ACEXML_Char *type_;
00111 ACEXML_Char *value_;
00112 };
00113
00114
00115
00116
00117 typedef ACE_Array<ACEXML_Attribute> ACEXML_Attribute_Array;
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143 class ACEXML_Export ACEXML_AttributesImpl
00144 : public ACEXML_Attributes
00145 {
00146 public:
00147
00148
00149
00150 ACEXML_AttributesImpl (int size = ACEXML_AttributesImpl_Default_Size);
00151 ACEXML_AttributesImpl (const ACEXML_AttributesImpl &attrs);
00152 virtual ~ACEXML_AttributesImpl (void);
00153
00154
00155
00156
00157
00158 virtual int addAttribute (const ACEXML_Char *uri,
00159 const ACEXML_Char *localName,
00160 const ACEXML_Char *qName,
00161 const ACEXML_Char *type,
00162 const ACEXML_Char *value);
00163 virtual int addAttribute (const ACEXML_Attribute &att);
00164
00165
00166
00167
00168 virtual int isDuplicate (const ACEXML_Char *uri,
00169 const ACEXML_Char *localName,
00170 const ACEXML_Char *qName);
00171
00172
00173
00174
00175
00176 virtual int removeAttribute (size_t index);
00177
00178
00179
00180
00181
00182
00183 virtual int getIndex (const ACEXML_Char *qName);
00184
00185
00186
00187
00188
00189 virtual int getIndex (const ACEXML_Char *uri,
00190 const ACEXML_Char *localPart);
00191
00192
00193
00194
00195 virtual size_t getLength (void);
00196
00197
00198
00199
00200
00201 virtual const ACEXML_Char *getLocalName (size_t index);
00202
00203
00204
00205
00206
00207 virtual const ACEXML_Char *getQName (size_t index);
00208
00209
00210
00211
00212
00213 virtual const ACEXML_Char *getType (size_t index);
00214
00215
00216
00217
00218
00219 virtual const ACEXML_Char *getType (const ACEXML_Char *qName);
00220
00221
00222
00223
00224
00225 virtual const ACEXML_Char *getType (const ACEXML_Char *uri,
00226 const ACEXML_Char *localPart);
00227
00228
00229
00230
00231
00232 virtual const ACEXML_Char *getURI (size_t index);
00233
00234
00235
00236
00237
00238 virtual const ACEXML_Char *getValue (size_t index);
00239
00240
00241
00242
00243
00244 virtual const ACEXML_Char *getValue (const ACEXML_Char *qName);
00245
00246
00247
00248
00249
00250 virtual const ACEXML_Char *getValue (const ACEXML_Char *uri,
00251 const ACEXML_Char *localPart);
00252
00253
00254
00255
00256
00257 virtual int setAttribute (size_t index,
00258 const ACEXML_Char *uri,
00259 const ACEXML_Char *localName,
00260 const ACEXML_Char *qName,
00261 const ACEXML_Char *type,
00262 const ACEXML_Char *value);
00263
00264
00265
00266
00267
00268 virtual int setLocalName (size_t index,
00269 const ACEXML_Char *localName);
00270
00271
00272
00273
00274
00275 virtual int setQName (size_t index,
00276 const ACEXML_Char *qName);
00277
00278
00279
00280
00281
00282 virtual int setURI (size_t index,
00283 const ACEXML_Char *uri);
00284
00285
00286
00287
00288
00289 virtual int setType (size_t index,
00290 const ACEXML_Char *type);
00291
00292
00293
00294
00295
00296 virtual int setValue (size_t index,
00297 const ACEXML_Char *value);
00298 private:
00299
00300 ACEXML_Attribute_Array attrs_;
00301 };
00302
00303 #if defined (__ACEXML_INLINE__)
00304 # include "ACEXML/common/AttributesImpl.i"
00305 #endif
00306
00307 #include "ace/post.h"
00308
00309 #endif