2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-11 07:30:57 +00:00
qpdf/include/qpdf/FileInputSource.hh
2014-01-14 15:40:02 -05:00

41 lines
1.1 KiB
C++

/* Copyright (c) 2005-2014 Jay Berkenbilt
*
* This file is part of qpdf. This software may be distributed under
* the terms of version 2 of the Artistic License which may be found
* in the source distribution. It is provided "as is" without express
* or implied warranty.
*/
#ifndef __QPDF_FILEINPUTSOURCE_HH__
#define __QPDF_FILEINPUTSOURCE_HH__
#include <qpdf/InputSource.hh>
class FileInputSource: public InputSource
{
public:
FileInputSource();
void setFilename(char const* filename);
void setFile(char const* description, FILE* filep, bool close_file);
virtual ~FileInputSource();
virtual qpdf_offset_t findAndSkipNextEOL();
virtual std::string const& getName() const;
virtual qpdf_offset_t tell();
virtual void seek(qpdf_offset_t offset, int whence);
virtual void rewind();
virtual size_t read(char* buffer, size_t length);
virtual void unreadCh(char ch);
private:
FileInputSource(FileInputSource const&);
FileInputSource& operator=(FileInputSource const&);
void destroy();
bool close_file;
std::string filename;
FILE* file;
};
#endif // __QPDF_FILEINPUTSOURCE_HH__