Xerces-C++: XSAnnotation.hpp Source File

| API Docs for SAX and DOM |
| Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages # XSAnnotation.hpp Go to the documentation of this file.
    00001 /*
    00002  * Copyright 2003,2004 The Apache Software Foundation.
    00003  *
    00004  * Licensed under the Apache License, Version 2.0 (the "License");
    00005  * you may not use this file except in compliance with the License.
    00006  * You may obtain a copy of the License at
    00007  *
    00008  *      http://www.apache.org/licenses/LICENSE-2.0
    00009  *
    00010  * Unless required by applicable law or agreed to in writing, software
    00011  * distributed under the License is distributed on an "AS IS" BASIS,
    00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013  * See the License for the specific language governing permissions and
    00014  * limitations under the License.
    00015  */
    00016
    00017 /*
    00018  * $Id: XSAnnotation.hpp 191054 2005-06-17 02:56:35Z jberry $
    00019  */
    00020
    00021 #if !defined(XSANNOTATION_HPP)
    00022 #define XSANNOTATION_HPP
    00023
    00024 #include <xercesc/framework/psvi/XSObject.hpp>
    00025 #include <xercesc/internal/XSerializable.hpp>
    00026
    00027 XERCES_CPP_NAMESPACE_BEGIN
    00028
    00036 // forward declarations
    00037 class DOMNode;
    00038 class ContentHandler;
    00039
    00040 class  XSAnnotation : public XSerializable, public XSObject
    00041 {
    00042 public:
    00043
    00044     // TargetType
    00045     enum ANNOTATION_TARGET {
    00049         W3C_DOM_ELEMENT           = 1,
    00053         W3C_DOM_DOCUMENT          = 2
    00054     };
    00055
    00056     //  Constructors and Destructor
    00057     // -----------------------------------------------------------------------
    00060
    00067     XSAnnotation
    00068     (
    00069         const XMLCh* const contents
    00070         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
    00071     );
    00072
    00074
    00077     ~XSAnnotation();
    00079
    00080     //---------------------
    00084
    00095     void writeAnnotation(DOMNode* node, ANNOTATION_TARGET targetType);
    00096
    00104     void writeAnnotation(ContentHandler* handler);
    00105
    00109     const XMLCh *getAnnotationString() const;
    00110     XMLCh *getAnnotationString();
    00111
    00113
    00114     //----------------------------------
    00117     void            setNext(XSAnnotation* const nextAnnotation);
    00118     XSAnnotation*   getNext();
    00120
    00121     //-----------------------------
    00124     inline void           getLineCol(int& line, int& col)  const;
    00125     inline const XMLCh*   getSystemId()                    const;
    00127
    00128     //-----------------------------
    00131     inline void           setLineCol(int line, int col);
    00132            void           setSystemId(const XMLCh* const systemId);
    00134
    00135     /***
    00136      * Support for Serialization/De-serialization
    00137      ***/
    00138     DECL_XSERIALIZABLE(XSAnnotation)
    00139     XSAnnotation(MemoryManager* const manager);
    00140
    00141 private:
    00142
    00143     // -----------------------------------------------------------------------
    00144     //  Unimplemented constructors and operators
    00145     // -----------------------------------------------------------------------
    00146     XSAnnotation(const XSAnnotation&);
    00147     XSAnnotation & operator=(const XSAnnotation &);
    00148
    00149 protected:
    00150
    00151     // -----------------------------------------------------------------------
    00152     //  data members
    00153     // -----------------------------------------------------------------------
    00154     XMLCh*        fContents;
    00155     XSAnnotation* fNext;
    00156
    00157 private:
    00158
    00159     XMLCh*        fSystemId;
    00160     int           fLine;
    00161     int           fCol;
    00162
    00163 };
    00164
    00165 inline const XMLCh *XSAnnotation::getAnnotationString() const
    00166 {
    00167     return fContents;
    00168 }
    00169
    00170 inline XMLCh *XSAnnotation::getAnnotationString()
    00171 {
    00172     return fContents;
    00173 }
    00174
    00175 inline void XSAnnotation::getLineCol(int& line, int& col) const
    00176 {
    00177     line = fLine;
    00178     col  = fCol;
    00179 }
    00180
    00181 inline const XMLCh* XSAnnotation::getSystemId() const
    00182 {
    00183     return fSystemId;
    00184 }
    00185
    00186 inline void XSAnnotation::setLineCol(int line, int col)
    00187 {
    00188     fLine = line;
    00189     fCol  = col;
    00190 }
    00191
    00192 XERCES_CPP_NAMESPACE_END
    00193
    00194 #endif

Copyright © 1994-2004 The Apache Software Foundation. All Rights Reserved.