//======================================================================== // // StdinCachedFile.cc // // This file is licensed under the GPLv2 or later // // Copyright 2010 Hib Eris // Copyright 2010 Albert Astals Cid // Copyright 2010 Jonathan Liu // //======================================================================== #include #include "StdinCachedFile.h" #ifdef _WIN32 # include // for O_BINARY # include // for setmode #endif #include size_t StdinCacheLoader::init(GooString *dummy, CachedFile *cachedFile) { size_t read, size = 0; char buf[CachedFileChunkSize]; #ifdef _WIN32 setmode(fileno(stdin), O_BINARY); #endif CachedFileWriter writer = CachedFileWriter(cachedFile, nullptr); do { read = fread(buf, 1, CachedFileChunkSize, stdin); (writer.write)(buf, CachedFileChunkSize); size += read; } while (read == CachedFileChunkSize); return size; } int StdinCacheLoader::load(const std::vector &ranges, CachedFileWriter *writer) { return 0; }