source: NonGTP/Xerces/xercesc/dom/DOMCharacterData.hpp @ 188

Revision 188, 10.9 KB checked in by mattausch, 19 years ago (diff)

added xercesc to support

Line 
1#ifndef DOMCharacterData_HEADER_GUARD_
2#define DOMCharacterData_HEADER_GUARD_
3
4/*
5 * The Apache Software License, Version 1.1
6 *
7 * Copyright (c) 2001-2002 The Apache Software Foundation.  All rights
8 * reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * 1. Redistributions of source code must retain the above copyright
15 *    notice, this list of conditions and the following disclaimer.
16 *
17 * 2. Redistributions in binary form must reproduce the above copyright
18 *    notice, this list of conditions and the following disclaimer in
19 *    the documentation and/or other materials provided with the
20 *    distribution.
21 *
22 * 3. The end-user documentation included with the redistribution,
23 *    if any, must include the following acknowledgment:
24 *       "This product includes software developed by the
25 *        Apache Software Foundation (http://www.apache.org/)."
26 *    Alternately, this acknowledgment may appear in the software itself,
27 *    if and wherever such third-party acknowledgments normally appear.
28 *
29 * 4. The names "Xerces" and "Apache Software Foundation" must
30 *    not be used to endorse or promote products derived from this
31 *    software without prior written permission. For written
32 *    permission, please contact apache\@apache.org.
33 *
34 * 5. Products derived from this software may not be called "Apache",
35 *    nor may "Apache" appear in their name, without prior written
36 *    permission of the Apache Software Foundation.
37 *
38 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
39 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
40 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
41 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
42 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
44 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
45 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
46 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
48 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
49 * SUCH DAMAGE.
50 * ====================================================================
51 *
52 * This software consists of voluntary contributions made by many
53 * individuals on behalf of the Apache Software Foundation, and was
54 * originally based on software copyright (c) 2001, International
55 * Business Machines, Inc., http://www.ibm.com .  For more information
56 * on the Apache Software Foundation, please see
57 * <http://www.apache.org/>.
58 */
59
60/*
61 * $Id: DOMCharacterData.hpp,v 1.8 2003/03/07 19:59:01 tng Exp $
62 */
63
64#include <xercesc/util/XercesDefs.hpp>
65#include <xercesc/dom/DOMNode.hpp>
66
67XERCES_CPP_NAMESPACE_BEGIN
68
69
70/**
71 * The <code>DOMCharacterData</code> interface extends DOMNode with a set of
72 * attributes and methods for accessing character data in the DOM. For
73 * clarity this set is defined here rather than on each object that uses
74 * these attributes and methods. No DOM objects correspond directly to
75 * <code>DOMCharacterData</code>, though <code>DOMText</code> and others do
76 * inherit the interface from it. All <code>offsets</code> in this interface
77 * start from <code>0</code>.
78 * <p>As explained in the DOM spec, text strings in
79 * the DOM are represented in UTF-16, i.e. as a sequence of 16-bit units. In
80 * the following, the term 16-bit units is used whenever necessary to
81 * indicate that indexing on DOMCharacterData is done in 16-bit units.
82 * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113'>Document Object Model (DOM) Level 2 Core Specification</a>.
83 * @since DOM Level 1
84 */
85class CDOM_EXPORT DOMCharacterData: public DOMNode {
86protected:
87    // -----------------------------------------------------------------------
88    //  Hidden constructors
89    // -----------------------------------------------------------------------
90    /** @name Hidden constructors */
91    //@{   
92    DOMCharacterData() {};
93    //@}
94
95private:
96    // -----------------------------------------------------------------------
97    // Unimplemented constructors and operators
98    // -----------------------------------------------------------------------
99    /** @name Unimplemented constructors and operators */
100    //@{
101    DOMCharacterData(const DOMCharacterData &);
102    DOMCharacterData & operator = (const DOMCharacterData &);
103    //@}
104
105public:
106    // -----------------------------------------------------------------------
107    //  All constructors are hidden, just the destructor is available
108    // -----------------------------------------------------------------------
109    /** @name Destructor */
110    //@{
111    /**
112     * Destructor
113     *
114     */
115    virtual ~DOMCharacterData() {};
116    //@}
117
118    // -----------------------------------------------------------------------
119    //  Virtual DOMCharacterData interface
120    // -----------------------------------------------------------------------
121    /** @name Functions introduced in DOM Level 1 */
122    //@{
123    // -----------------------------------------------------------------------
124    //  Getter methods
125    // -----------------------------------------------------------------------
126    /**
127     * Returns the character data of the node that implements this interface.
128     *
129     * The DOM implementation may not put arbitrary limits on the amount of data that
130     * may be stored in a  <code>DOMCharacterData</code> node. However,
131     * implementation limits may  mean that the entirety of a node's data may
132     * not fit into a single <code>XMLCh* String</code>. In such cases, the user
133     * may call <code>substringData</code> to retrieve the data in
134     * appropriately sized pieces.
135     * @exception DOMException
136     *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
137     * @since DOM Level 1
138     */
139    virtual const XMLCh *     getData() const = 0;
140
141    /**
142     * Returns the number of characters that are available through <code>data</code> and
143     * the <code>substringData</code> method below.
144     *
145     * This may have the value
146     * zero, i.e., <code>CharacterData</code> nodes may be empty.
147     * @since DOM Level 1
148     */
149    virtual XMLSize_t       getLength() const = 0;
150
151    /**
152     * Extracts a range of data from the node.
153     *
154     * @param offset Start offset of substring to extract.
155     * @param count The number of characters to extract.
156     * @return The specified substring. If the sum of <code>offset</code> and
157     *   <code>count</code> exceeds the <code>length</code>, then all
158     *   characters to the end of the data are returned.
159     * @exception DOMException
160     *   INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
161     *   than the number of characters in <code>data</code>, or if the
162     *   specified <code>count</code> is negative.
163     * @since DOM Level 1
164     */
165    virtual const XMLCh *     substringData(XMLSize_t offset,
166                                     XMLSize_t count) const = 0;
167
168    // -----------------------------------------------------------------------
169    //  String methods
170    // -----------------------------------------------------------------------
171    /**
172     * Append the string to the end of the character data of the node.
173     *
174     * Upon success, <code>data</code> provides access to the concatenation of
175     * <code>data</code> and the <code>XMLCh* String</code> specified.
176     * @param arg The <code>XMLCh* String</code> to append.
177     * @exception DOMException
178     *   NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
179     * @since DOM Level 1
180     */
181    virtual void               appendData(const XMLCh *arg) = 0;
182
183    /**
184     * Insert a string at the specified character offset.
185     *
186     * @param offset The character offset at which to insert.
187     * @param arg The <code>XMLCh* String</code> to insert.
188     * @exception DOMException
189     *   INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
190     *   than the number of characters in <code>data</code>.
191     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
192     * @since DOM Level 1
193     */
194    virtual void               insertData(XMLSize_t offset, const  XMLCh *arg) = 0;
195
196    /**
197     * Remove a range of characters from the node.
198     *
199     * Upon success,
200     * <code>data</code> and <code>length</code> reflect the change.
201     * @param offset The offset from which to remove characters.
202     * @param count The number of characters to delete. If the sum of
203     *   <code>offset</code> and <code>count</code> exceeds <code>length</code>
204     *   then all characters from <code>offset</code> to the end of the data
205     *   are deleted.
206     * @exception DOMException
207     *   INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
208     *   than the number of characters in <code>data</code>, or if the
209     *   specified <code>count</code> is negative.
210     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
211     * @since DOM Level 1
212     */
213    virtual void               deleteData(XMLSize_t offset,
214                                  XMLSize_t count) = 0;
215
216    /**
217     * Replace the characters starting at the specified character offset with
218     * the specified string.
219     *
220     * @param offset The offset from which to start replacing.
221     * @param count The number of characters to replace. If the sum of
222     *   <code>offset</code> and <code>count</code> exceeds <code>length</code>
223     *   , then all characters to the end of the data are replaced (i.e., the
224     *   effect is the same as a <code>remove</code> method call with the same
225     *   range, followed by an <code>append</code> method invocation).
226     * @param arg The <code>XMLCh* String</code> with which the range must be
227     *   replaced.
228     * @exception DOMException
229     *   INDEX_SIZE_ERR: Raised if the specified offset is negative or greater
230     *   than the number of characters in <code>data</code>, or if the
231     *   specified <code>count</code> is negative.
232     *   <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
233     * @since DOM Level 1
234     */
235    virtual void               replaceData(XMLSize_t offset,
236                                   XMLSize_t count,
237                                   const XMLCh *arg) = 0;
238
239    /**
240     * Sets the character data of the node that implements this interface.
241     *
242     * @param data The <code>XMLCh* String</code> to set.
243     * @since DOM Level 1
244     */
245    virtual void               setData(const XMLCh *data) = 0;
246    //@}
247
248};
249
250XERCES_CPP_NAMESPACE_END
251
252#endif
253
254
Note: See TracBrowser for help on using the repository browser.