http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Charter
Release Info

Installation
Download
Build Instructions

FAQs
Samples
API Docs

DOM C++ Binding
Programming
Migration Guide

Feedback
Bug-Reporting
PDF Document

Source Repository
User Mail Archive
Devel Mail Archive

API Docs for SAX and DOM
 

BinFileInputStream.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 1999-2000,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: BinFileInputStream.hpp 191054 2005-06-17 02:56:35Z jberry $
00019  */
00020 
00021 #if !defined(BINFILEINPUTSTREAM_HPP)
00022 #define BINFILEINPUTSTREAM_HPP
00023 
00024 #include <xercesc/util/BinInputStream.hpp>
00025 #include <xercesc/util/PlatformUtils.hpp>
00026 
00027 XERCES_CPP_NAMESPACE_BEGIN
00028 
00029 class  BinFileInputStream : public BinInputStream
00030 {
00031 public :
00032     // -----------------------------------------------------------------------
00033     //  Constructors and Destructor
00034     // -----------------------------------------------------------------------
00035     BinFileInputStream
00036     (
00037         const   XMLCh* const    fileName
00038         , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00039     );
00040 
00041     BinFileInputStream
00042     (
00043         const   char* const     fileName
00044         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
00045     );
00046 
00047     BinFileInputStream
00048     (
00049         const   FileHandle      toUse
00050         , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager
00051     );
00052 
00053     virtual ~BinFileInputStream();
00054 
00055 
00056     // -----------------------------------------------------------------------
00057     //  Getter methods
00058     // -----------------------------------------------------------------------
00059     bool getIsOpen() const;
00060     unsigned int getSize() const;
00061     void reset();
00062 
00063 
00064     // -----------------------------------------------------------------------
00065     //  Implementation of the input stream interface
00066     // -----------------------------------------------------------------------
00067     virtual unsigned int curPos() const;
00068 
00069     virtual unsigned int readBytes
00070     (
00071                 XMLByte* const      toFill
00072         , const unsigned int        maxToRead
00073     );
00074 
00075 
00076 private :
00077     // -----------------------------------------------------------------------
00078     //  Unimplemented constructors and operators
00079     // -----------------------------------------------------------------------
00080     BinFileInputStream(const BinFileInputStream&);
00081     BinFileInputStream& operator=(const BinFileInputStream&);   
00082 
00083     // -----------------------------------------------------------------------
00084     //  Private data members
00085     //
00086     //  fSource
00087     //      The source file that we represent. The FileHandle type is defined
00088     //      per platform.
00089     // -----------------------------------------------------------------------
00090     FileHandle              fSource;
00091     MemoryManager* const    fMemoryManager;
00092 };
00093 
00094 
00095 // ---------------------------------------------------------------------------
00096 //  BinFileInputStream: Getter methods
00097 // ---------------------------------------------------------------------------
00098 inline bool BinFileInputStream::getIsOpen() const
00099 {
00100     return (fSource != (FileHandle) XERCES_Invalid_File_Handle);
00101 }
00102 
00103 XERCES_CPP_NAMESPACE_END
00104 
00105 #endif


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