secureswitools/swisistools/source/xmlparser/xerces/include/xercesc/util/NetAccessors/MacOSURLAccessCF/URLAccessCFBinInputStream.hpp
changeset 0 ba25891c3a9e
child 1 c42dffbd5b4f
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 /*
       
    18  * Licensed to the Apache Software Foundation (ASF) under one or more
       
    19  * contributor license agreements.  See the NOTICE file distributed with
       
    20  * this work for additional information regarding copyright ownership.
       
    21  * The ASF licenses this file to You under the Apache License, Version 2.0
       
    22  * (the "License"); you may not use this file except in compliance with
       
    23  * the License.  You may obtain a copy of the License at
       
    24  * 
       
    25  *      http://www.apache.org/licenses/LICENSE-2.0
       
    26  * 
       
    27  * Unless required by applicable law or agreed to in writing, software
       
    28  * distributed under the License is distributed on an "AS IS" BASIS,
       
    29  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    30  * See the License for the specific language governing permissions and
       
    31  * limitations under the License.
       
    32  */
       
    33 
       
    34 /*
       
    35  * $Id: URLAccessCFBinInputStream.hpp 568078 2007-08-21 11:43:25Z amassari $
       
    36  */
       
    37 
       
    38 #if !defined(URLACCESSCFBININPUTSTREAM_HPP)
       
    39 #define URLACCESSCFBININPUTSTREAM_HPP
       
    40 
       
    41 
       
    42 #include <xercesc/util/XMLURL.hpp>
       
    43 #include <xercesc/util/XMLExceptMsgs.hpp>
       
    44 #include <xercesc/util/BinInputStream.hpp>
       
    45 
       
    46 #if defined(__APPLE__)
       
    47     //	Framework includes from ProjectBuilder
       
    48 	#include <CoreServices/CoreServices.h>
       
    49 #else
       
    50     //	Classic includes otherwise
       
    51 	#include <CFURL.h>
       
    52 	#include <CFURLAccess.h>
       
    53 #endif
       
    54 
       
    55 XERCES_CPP_NAMESPACE_BEGIN
       
    56 
       
    57 //
       
    58 // This class implements the BinInputStream interface specified by the XML
       
    59 // parser.
       
    60 //
       
    61 
       
    62 class XMLUTIL_EXPORT URLAccessCFBinInputStream : public BinInputStream
       
    63 {
       
    64 public :
       
    65     URLAccessCFBinInputStream(const XMLURL&  urlSource);
       
    66     ~URLAccessCFBinInputStream();
       
    67 
       
    68     unsigned int curPos() const;
       
    69     unsigned int readBytes
       
    70     (
       
    71                 XMLByte* const  toFill
       
    72         , const unsigned int    maxToRead
       
    73     );
       
    74 
       
    75 
       
    76 private :
       
    77     CFDataRef			mDataRef;
       
    78     CFIndex				mBytesProcessed;
       
    79 };
       
    80 
       
    81 
       
    82 inline unsigned int
       
    83 URLAccessCFBinInputStream::curPos() const
       
    84 {
       
    85     return mBytesProcessed;
       
    86 }
       
    87 
       
    88 XERCES_CPP_NAMESPACE_END
       
    89 
       
    90 #endif // URLACCESSCFBININPUTSTREAM_HPP