📄 xmlattdef.hpp
字号:
* @return the plugged-in memory manager */ MemoryManager* getMemoryManager() const; /** * @return the uri part of DOM Level 3 TypeInfo * @deprecated */ virtual const XMLCh* getDOMTypeInfoUri() const = 0; /** * @return the name part of DOM Level 3 TypeInfo * @deprecated */ virtual const XMLCh* getDOMTypeInfoName() const = 0; //@} // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** @name Setter methods */ //@{ /** Set the default attribute type * * This method sets the default attribute type for this attribute. * This setting controls whether the attribute is required, fixed, * implied, etc... * * @param newValue The new default attribute to set */ void setDefaultType(const XMLAttDef::DefAttTypes newValue); /** Set the pool id for this attribute type. * * This method sets the pool id of this attribute type. This is usually * called by the validator that creates the actual instance (which is of * a derived type known only by the validator.) * * @param newId The new pool id to set. */ void setId(const unsigned int newId); /** Set or clear the 'provided' flag. * * This method will set or clear the 'provided' flag. This is called * by the scanner as it is scanning a start tag and marking off the * attributes that have been explicitly provided. * * @param newValue The new provided state to set * @deprecated */ void setProvided(const bool newValue); /** Set the type of this attribute type. * * This method will set the type of the attribute. The type of an attribute * controls how it is normalized and what kinds of characters it can hold. * * @param newValue The new attribute type to set */ void setType(const XMLAttDef::AttTypes newValue); /** Set the default/fixed value of this attribute type. * * This method set the fixed/default value for the attribute. This value * will be used when instances of this attribute type are faulted in. It * <b>must</b> be a valid value for the type set by setType(). If the * type is enumeration or notation, this must be one of the valid values * set in the setEnumeration() call. * * @param newValue The new fixed/default value to set. */ void setValue(const XMLCh* const newValue); /** Set the enumerated value of this attribute type. * * This method sets the enumerated/notation value list for this attribute * type. It is a space separated set of possible values. These values must * meet the constrains of the XML spec for such values of this type of * attribute. This should only be set if the setType() method is used to * set the type to the enumeration or notation types. * * @param newValue The new enumerated/notation value list to set. */ void setEnumeration(const XMLCh* const newValue); /** Update the create reason for this attribute type. * * This method will update the 'create reason' field for this attribute * decl object. * * @param newReason The new create reason. */ void setCreateReason(const CreateReasons newReason); /** * Set the attribute decl to indicate external declaration * * @param aValue The new value to indicate external declaration. */ void setExternalAttDeclaration(const bool aValue); //@} /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(XMLAttDef)protected : // ----------------------------------------------------------------------- // Hidden constructors // ----------------------------------------------------------------------- XMLAttDef ( const AttTypes type = CData , const DefAttTypes defType= Implied , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager ); XMLAttDef ( const XMLCh* const attValue , const AttTypes type , const DefAttTypes defType , const XMLCh* const enumValues = 0 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager );private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- XMLAttDef(const XMLAttDef&); XMLAttDef& operator=(const XMLAttDef&); // ----------------------------------------------------------------------- // Private helper methods // ----------------------------------------------------------------------- void cleanUp(); // ----------------------------------------------------------------------- // Private data members // // fDefaultType // Indicates what, if any, default stuff this attribute has. // // fEnumeration // If its an enumeration, this is the list of values as space // separated values. // // fId // This is the unique id of this attribute, given to it when its put // into the validator's attribute decl pool. It defaults to the // special value XMLAttrDef::fgInvalidAttrId. // // fProvided // This field is really for use by the scanner. It is used to track // which of the attributes of an element were provided. Any marked // as not provided (after scanning the start tag) and having a // default type of Required, is in error. // // fType // The type of attribute, which is one of the AttTypes values. // // fValue // This is the value of the attribute, which is the default value // given in the attribute declaration. // // fCreateReason // This flag tells us how this attribute got created. Sometimes even // the attribute was not declared for the element, we want to fault // fault it into the pool to avoid lots of redundant errors. // // fExternalAttribute // This flag indicates whether or not the attribute was declared externally. // ----------------------------------------------------------------------- DefAttTypes fDefaultType; AttTypes fType; CreateReasons fCreateReason; bool fProvided; bool fExternalAttribute; unsigned int fId; XMLCh* fValue; XMLCh* fEnumeration; MemoryManager* fMemoryManager;};// ---------------------------------------------------------------------------// Getter methods// ---------------------------------------------------------------------------inline XMLAttDef::DefAttTypes XMLAttDef::getDefaultType() const{ return fDefaultType;}inline const XMLCh* XMLAttDef::getEnumeration() const{ return fEnumeration;}inline unsigned int XMLAttDef::getId() const{ return fId;}inline bool XMLAttDef::getProvided() const{ return fProvided;}inline XMLAttDef::AttTypes XMLAttDef::getType() const{ return fType;}inline const XMLCh* XMLAttDef::getValue() const{ return fValue;}inline XMLAttDef::CreateReasons XMLAttDef::getCreateReason() const{ return fCreateReason;}inline bool XMLAttDef::isExternal() const{ return fExternalAttribute;}inline MemoryManager* XMLAttDef::getMemoryManager() const{ return fMemoryManager;}// ---------------------------------------------------------------------------// XMLAttDef: Setter methods// ---------------------------------------------------------------------------inline void XMLAttDef::setDefaultType(const XMLAttDef::DefAttTypes newValue){ fDefaultType = newValue;}inline void XMLAttDef::setEnumeration(const XMLCh* const newValue){ if (fEnumeration) fMemoryManager->deallocate(fEnumeration); fEnumeration = XMLString::replicate(newValue, fMemoryManager);}inline void XMLAttDef::setId(const unsigned int newId){ fId = newId;}inline void XMLAttDef::setProvided(const bool newValue){ fProvided = newValue;}inline void XMLAttDef::setType(const XMLAttDef::AttTypes newValue){ fType = newValue;}inline void XMLAttDef::setValue(const XMLCh* const newValue){ if (fValue) fMemoryManager->deallocate(fValue); fValue = XMLString::replicate(newValue, fMemoryManager);}inline voidXMLAttDef::setCreateReason(const XMLAttDef::CreateReasons newReason){ fCreateReason = newReason;}inline void XMLAttDef::setExternalAttDeclaration(const bool aValue){ fExternalAttribute = aValue;}XERCES_CPP_NAMESPACE_END#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -