Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:48

0001 // @(#)root/io:$Id$
0002 // Author: Jakob Blomer
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_RRawFileWin
0013 #define ROOT_RRawFileWin
0014 
0015 #include <ROOT/RRawFile.hxx>
0016 #include <string_view>
0017 
0018 #include <cstddef>
0019 #include <cstdint>
0020 #include <cstdio>
0021 
0022 namespace ROOT {
0023 namespace Internal {
0024 
0025 /**
0026  * \class RRawFileWin RRawFileWin.hxx
0027  * \ingroup IO
0028  *
0029  * The RRawFileWin class uses portable C I/O calls to read from a drive. The standard C I/O buffering is turned off
0030  * for the buffering of RRawFile base class.
0031  */
0032 class RRawFileWin : public RRawFile {
0033 private:
0034    FILE *fFilePtr;
0035    void Seek(long offset, int whence);
0036 
0037 protected:
0038    void OpenImpl() final;
0039    size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final;
0040    std::uint64_t GetSizeImpl() final;
0041 
0042 public:
0043    RRawFileWin(std::string_view url, RRawFile::ROptions options);
0044    ~RRawFileWin() override;
0045    std::unique_ptr<RRawFile> Clone() const final;
0046    int GetFeatures() const final { return kFeatureHasSize; }
0047 };
0048 
0049 } // namespace Internal
0050 } // namespace ROOT
0051 
0052 #endif