Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:11

0001 /*
0002  * Licensed to the Apache Software Foundation (ASF) under one or more
0003  * contributor license agreements.  See the NOTICE file distributed with
0004  * this work for additional information regarding copyright ownership.
0005  * The ASF licenses this file to You under the Apache License, Version 2.0
0006  * (the "License"); you may not use this file except in compliance with
0007  * the License.  You may obtain a copy of the License at
0008  *
0009  *      http://www.apache.org/licenses/LICENSE-2.0
0010  *
0011  * Unless required by applicable law or agreed to in writing, software
0012  * distributed under the License is distributed on an "AS IS" BASIS,
0013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0014  * See the License for the specific language governing permissions and
0015  * limitations under the License.
0016  */
0017 
0018 /*
0019  * $Id$
0020  */
0021 
0022 #if !defined(XERCESC_INCLUDE_GUARD_BININPUTSTREAM_HPP)
0023 #define XERCESC_INCLUDE_GUARD_BININPUTSTREAM_HPP
0024 
0025 #include <xercesc/util/XMemory.hpp>
0026 
0027 XERCES_CPP_NAMESPACE_BEGIN
0028 
0029 class XMLUTIL_EXPORT BinInputStream : public XMemory
0030 {
0031 public :
0032     // -----------------------------------------------------------------------
0033     //  Virtual destructor for derived classes
0034     // -----------------------------------------------------------------------
0035     virtual ~BinInputStream();
0036 
0037 
0038     // -----------------------------------------------------------------------
0039     //  The virtual input stream interface
0040     // -----------------------------------------------------------------------
0041     virtual XMLFilePos curPos() const = 0;
0042 
0043     virtual XMLSize_t readBytes
0044     (
0045                 XMLByte* const      toFill
0046         , const XMLSize_t           maxToRead
0047     ) = 0;
0048 
0049     /**
0050      * Return the "out-of-band" content type for the data supplied by this
0051      * input stream in the form of the media-type production (mime type
0052      * with optional parameters such as encoding) as defined by the HTTP 1.1
0053      * specification. If no such content type is provided for the data, 0 is
0054      * returned. This function is expected to return the correct value at
0055      * any time after the construction of the stream.
0056      *
0057      * An example of the stream that may return non-0 from this function is
0058      * an HTTP stream with the value returned taken from the "Content-Type"
0059      * HTTP header. Note also that if the encoding of the data is known
0060      * to the application by some other means then the setEncoding function
0061      * in the InputSource object should be used instead. The getContentType
0062      * function should only be used to return information that is intrinsic
0063      * to the stream.
0064      *
0065      * @return The content type, or 0 if one is not available.
0066      */
0067     virtual const XMLCh* getContentType() const = 0;
0068 
0069     /**
0070      * Return the "out-of-band" encoding for the data supplied by this
0071      * input stream. If no such content type is provided for the data, 0 is
0072      * returned. This function is expected to return the correct value at
0073      * any time after the construction of the stream.
0074      *
0075      * An example of the stream that may return non-0 from this function is
0076      * an HTTP stream with the value returned taken from the "Content-Type"
0077      * HTTP header. Note also that if the encoding of the data is known
0078      * to the application by some other means then the setEncoding function
0079      * in the InputSource object should be used instead. The getEncoding
0080      * function should only be used to return information that is intrinsic
0081      * to the stream.
0082      *
0083      * @return The name of the encoding, or 0 if one is not available.
0084      */
0085     virtual const XMLCh *getEncoding() const;
0086 
0087 protected :
0088     // -----------------------------------------------------------------------
0089     //  Hidden Constructors
0090     // -----------------------------------------------------------------------
0091     BinInputStream();
0092 
0093 
0094 private :
0095     // -----------------------------------------------------------------------
0096     //  Unimplemented Constructors
0097     // -----------------------------------------------------------------------
0098     BinInputStream(const BinInputStream&);
0099     BinInputStream& operator=(const BinInputStream&);
0100 };
0101 
0102 XERCES_CPP_NAMESPACE_END
0103 
0104 #endif