OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
foreign_storage::SingleFileReader Class Referenceabstract

#include <FileReader.h>

+ Inheritance diagram for foreign_storage::SingleFileReader:
+ Collaboration diagram for foreign_storage::SingleFileReader:

Public Member Functions

 SingleFileReader (const std::string &file_path, const import_export::CopyParams &copy_params)
 
 ~SingleFileReader () override=default
 
FirstLineByFilePath getFirstLineForEachFile () const override
 
bool isEndOfLastFile () override
 
- Public Member Functions inherited from foreign_storage::FileReader
 FileReader (const std::string &file_path, const import_export::CopyParams &copy_params)
 
virtual ~FileReader ()=default
 
virtual size_t read (void *buffer, size_t max_size)=0
 
virtual bool isScanFinished ()=0
 
virtual size_t readRegion (void *buffer, size_t offset, size_t size)=0
 
virtual size_t getRemainingSize ()=0
 
virtual bool isRemainingSizeKnown ()=0
 
virtual void checkForMoreRows (size_t file_offset, const ForeignServer *server_options=nullptr, const UserMapping *user_mapping=nullptr)
 
virtual void serialize (rapidjson::Value &value, rapidjson::Document::AllocatorType &allocator) const =0
 

Protected Member Functions

virtual std::string getFirstLine () const =0
 
virtual void skipHeader ()=0
 

Static Protected Attributes

static constexpr size_t DEFAULT_HEADER_READ_SIZE {1024}
 

Additional Inherited Members

- Protected Attributes inherited from foreign_storage::FileReader
import_export::CopyParams copy_params_
 
std::string file_path_
 

Detailed Description

Definition at line 122 of file FileReader.h.

Constructor & Destructor Documentation

foreign_storage::SingleFileReader::SingleFileReader ( const std::string &  file_path,
const import_export::CopyParams copy_params 
)

Definition at line 72 of file FileReader.cpp.

74  : FileReader(file_path, copy_params) {}
FileReader(const std::string &file_path, const import_export::CopyParams &copy_params)
Definition: FileReader.h:41
foreign_storage::SingleFileReader::~SingleFileReader ( )
overridedefault

Member Function Documentation

virtual std::string foreign_storage::SingleFileReader::getFirstLine ( ) const
protectedpure virtual

Implemented in foreign_storage::CompressedFileReader, and foreign_storage::SingleTextFileReader.

Referenced by getFirstLineForEachFile().

+ Here is the caller graph for this function:

FirstLineByFilePath foreign_storage::SingleFileReader::getFirstLineForEachFile ( ) const
overridevirtual

Returns a map containing the first line for each file that will be read.

Implements foreign_storage::FileReader.

Definition at line 76 of file FileReader.cpp.

References foreign_storage::FileReader::file_path_, and getFirstLine().

76  {
77  return {{file_path_, getFirstLine()}};
78 }
virtual std::string getFirstLine() const =0

+ Here is the call graph for this function:

bool foreign_storage::SingleFileReader::isEndOfLastFile ( )
overridevirtual

Returns a boolean indicating whether the reader is at the end of the last file that was read.

Implements foreign_storage::FileReader.

Definition at line 80 of file FileReader.cpp.

References foreign_storage::FileReader::isScanFinished().

80  {
81  return isScanFinished();
82 }
virtual bool isScanFinished()=0

+ Here is the call graph for this function:

virtual void foreign_storage::SingleFileReader::skipHeader ( )
protectedpure virtual

Member Data Documentation

constexpr size_t foreign_storage::SingleFileReader::DEFAULT_HEADER_READ_SIZE {1024}
staticprotected

Definition at line 137 of file FileReader.h.

Referenced by foreign_storage::CompressedFileReader::getFirstLine().


The documentation for this class was generated from the following files: