OmniSciDB  72c90bc290
 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
std::string getCurrentFilePath () const 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 () const =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 shared::FilePathOptions &options, 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 132 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 73 of file FileReader.cpp.

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

Member Function Documentation

std::string foreign_storage::SingleFileReader::getCurrentFilePath ( ) const

Returns the path of the currently processed file.

Implements foreign_storage::FileReader.

Definition at line 85 of file FileReader.cpp.

References foreign_storage::FileReader::file_path_.

85  {
86  return file_path_;
87 }
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

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

Implements foreign_storage::FileReader.

Definition at line 77 of file FileReader.cpp.

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

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

+ Here is the call graph for this function:

bool foreign_storage::SingleFileReader::isEndOfLastFile ( )

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 81 of file FileReader.cpp.

References foreign_storage::FileReader::isScanFinished().

81  {
82  return isScanFinished();
83 }
virtual bool isScanFinished() const =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}

Definition at line 149 of file FileReader.h.

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

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