Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RRawFileWin.hxx
Go to the documentation of this file.
1// @(#)root/io:$Id$
2// Author: Jakob Blomer
3
4/*************************************************************************
5 * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_RRawFileWin
13#define ROOT_RRawFileWin
14
15#include <ROOT/RRawFile.hxx>
16#include <string_view>
17
18#include <cstddef>
19#include <cstdint>
20#include <cstdio>
21
22namespace ROOT {
23namespace Internal {
24
25/**
26 * \class RRawFileWin RRawFileWin.hxx
27 * \ingroup io_files
28 *
29 * The RRawFileWin class uses portable C I/O calls to read from a drive. The standard C I/O buffering is turned off
30 * for the buffering of RRawFile base class.
31 */
32class RRawFileWin : public RRawFile {
33private:
34 FILE *fFilePtr = nullptr;
35 void Seek(long offset, int whence);
36
37protected:
38 void OpenImpl() final;
39 size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final;
40 std::uint64_t GetSizeImpl() final;
41
42public:
43 RRawFileWin(std::string_view url, RRawFile::ROptions options);
44 ~RRawFileWin() override;
45 std::unique_ptr<RRawFile> Clone() const final;
46};
47
48} // namespace Internal
49} // namespace ROOT
50
51#endif
RRawFileWin(std::string_view url, RRawFile::ROptions options)
size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final
Derived classes should implement low-level reading without buffering.
std::unique_ptr< RRawFile > Clone() const final
Create a new RawFile that accesses the same resource. The file pointer is reset to zero.
std::uint64_t GetSizeImpl() final
Derived classes should return the file size.
void Seek(long offset, int whence)
void OpenImpl() final
OpenImpl() is called at most once and before any call to either DoReadAt or DoGetSize.
RRawFile(std::string_view url, ROptions options)
Definition RRawFile.cxx:61
STL class.
STL class.
On construction, an ROptions parameter can customize the RRawFile behavior.
Definition RRawFile.hxx:49