iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iceberg::test::StdFileIO Class Reference

Simple local filesystem FileIO implementation for testing. More...

#include <std_io.h>

Inheritance diagram for iceberg::test::StdFileIO:
iceberg::FileIO

Public Member Functions

Result< std::unique_ptr< InputFile > > NewInputFile (std::string file_location) override
 Create an input file handle for the given location.
 
Result< std::unique_ptr< InputFile > > NewInputFile (std::string file_location, size_t length) override
 Create an input file handle for the given location with a known length.
 
Result< std::unique_ptr< OutputFile > > NewOutputFile (std::string file_location) override
 Create an output file handle for the given location.
 
Status DeleteFile (const std::string &file_location) override
 Delete a file at the given location.
 
- Public Member Functions inherited from iceberg::FileIO
virtual Result< std::string > ReadFile (const std::string &file_location, std::optional< size_t > length)
 Read the content of the file at the given location.
 
virtual Status WriteFile (const std::string &file_location, std::string_view content)
 Write the given content to the file at the given location.
 

Detailed Description

Simple local filesystem FileIO implementation for testing.

This class provides a basic FileIO implementation that reads and writes files to the local filesystem using standard C++ file streams.

Member Function Documentation

◆ DeleteFile()

Status iceberg::test::StdFileIO::DeleteFile ( const std::string &  file_location)
inlineoverridevirtual

Delete a file at the given location.

Parameters
file_locationThe location of the file to delete.
Returns
void if the delete succeeded, an error code if the delete failed.

Reimplemented from iceberg::FileIO.

◆ NewInputFile() [1/2]

Result< std::unique_ptr< InputFile > > iceberg::test::StdFileIO::NewInputFile ( std::string  file_location)
inlineoverridevirtual

Create an input file handle for the given location.

Reimplemented from iceberg::FileIO.

◆ NewInputFile() [2/2]

Result< std::unique_ptr< InputFile > > iceberg::test::StdFileIO::NewInputFile ( std::string  file_location,
size_t  length 
)
inlineoverridevirtual

Create an input file handle for the given location with a known length.

The length is a caller-provided content length hint. Implementations may use it to avoid an extra metadata lookup.

Reimplemented from iceberg::FileIO.

◆ NewOutputFile()

Result< std::unique_ptr< OutputFile > > iceberg::test::StdFileIO::NewOutputFile ( std::string  file_location)
inlineoverridevirtual

Create an output file handle for the given location.

Reimplemented from iceberg::FileIO.


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