20 :
TFile(url, strstr(opt,
"_WITHOUT_GLOBALREGISTRATION") != nullptr ?
"WEB_WITHOUT_GLOBALREGISTRATION" :
"WEB"),
46 Error(
"Seek",
"seeking from end in archive is not (yet) supported");
55 range.fDestination =
reinterpret_cast<unsigned char *
>(buf);
58 auto status =
fConnection->SendRangesReq(1, &range);
60 Error(
"TCurlFile",
"can not read data: %s", status.fStatusMsg.c_str());
80 range.fDestination =
reinterpret_cast<unsigned char *
>(buf);
83 auto status =
fConnection->SendRangesReq(1, &range);
85 Error(
"TCurlFile",
"can not read data: %s", status.fStatusMsg.c_str());
105 std::vector<ROOT::Internal::RCurlConnection::RUserRange> ranges;
106 ranges.reserve(nbuf);
107 std::size_t bufPos = 0;
108 for (
Int_t i = 0; i < nbuf; ++i) {
110 r.fDestination =
reinterpret_cast<unsigned char *
>(&buf[bufPos]);
113 ranges.emplace_back(
r);
123 auto status =
fConnection->SendRangesReq(nbuf, &ranges[0]);
125 Error(
"TCurlFile",
"can not read data: %s", status.fStatusMsg.c_str());
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
TCurlFile(const char *url, Option_t *option="")
std::unique_ptr< ROOT::Internal::RCurlConnection > fConnection
Bool_t ReadBuffer(char *buf, Int_t len) override
Read a buffer from the file.
Long64_t GetSize() const override
Returns the current file size.
Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf) override
Read the nbuf blocks described in arrays pos and len.
void Seek(Long64_t offset, ERelativeTo pos=kBeg) override
Seek to a specific position in the file. Pos it either kBeg, kCur or kEnd.
static std::atomic< Long64_t > fgBytesRead
Number of bytes read by all TFile objects.
Int_t fReadCalls
Number of read calls ( not counting the cache calls ).
Long64_t fBytesRead
Number of bytes read from this file.
static void SetFileBytesRead(Long64_t bytes=0)
static void SetFileReadCalls(Int_t readcalls=0)
static Long64_t GetFileBytesRead()
Static function returning the total number of bytes read from all files.
Long64_t fArchiveOffset
!Offset at which file starts in archive
virtual void Init(Bool_t create)
Initialize a TFile object.
TFile(const TFile &)=delete
Long64_t fOffset
!Seek offset cache
Long64_t fEND
Last used byte in file.
static std::atomic< Int_t > fgReadCalls
Number of bytes read from all TFile objects.
static Int_t GetFileReadCalls()
Static function returning the total number of read calls from all files.
Small utility to parse cmdline options.
Caller-provided byte-range of the remote resource together with a pointer to a buffer.