1 //========================================================================
5 // This file is licensed under the GPLv2 or later
7 // Copyright 2010 Michal Wozniak <wozniak_m@interia.pl>
9 //========================================================================
13 #include "poppler_io.h"
17 size_t StdCacheLoader::init(GooString
*fname
, CachedFile
*cachedFile
)
19 size_t read
, size
= 0;
20 FILE *f
= fopen(fname
->getCString(), "r");
24 char buf
[CachedFileChunkSize
];
26 CachedFileWriter writer
= CachedFileWriter (cachedFile
, NULL
);
28 read
= fread(buf
, 1, CachedFileChunkSize
, f
);
29 (writer
.write
) (buf
, CachedFileChunkSize
);
32 while (read
== CachedFileChunkSize
);
38 int StdCacheLoader::load(const std::vector
<ByteRange
> &ranges
, CachedFileWriter
*writer
)