vg
tools for working with variation graphs
|
#include <gaf_sorter.hpp>
Public Member Functions | |
GAFSorterFile () | |
Default constructor that creates a compressed temporary file. More... | |
GAFSorterFile (const std::string &name) | |
Constructor that creates a raw GAF file with the given name. More... | |
~GAFSorterFile () | |
If the file is temporary, the destructor removes the file. More... | |
GAFSorterFile (const GAFSorterFile &)=delete | |
GAFSorterFile & | operator= (const GAFSorterFile &)=delete |
GAFSorterFile (GAFSorterFile &&)=default | |
GAFSorterFile & | operator= (GAFSorterFile &&)=default |
std::pair< std::ostream *, std::unique_ptr< std::ostream > > | open_output () |
void | write (const GAFSorterRecord &record, std::ostream &out) |
std::pair< std::istream *, std::unique_ptr< std::istream > > | open_input () |
void | read (GAFSorterRecord &record, std::istream &in) |
bool | is_std_in_out () const |
void | remove_temporary () |
Removes the file if it is temporary. More... | |
Public Attributes | |
std::string | name |
File name. More... | |
size_t | records |
Number of records. More... | |
bool | temporary |
Is this a temporary file created with temp_file::create()? More... | |
bool | compressed |
Is this file compressed? More... | |
bool | raw_gaf |
Is this a raw GAF file? More... | |
bool | removed |
Has the file been removed? More... | |
bool | ok |
Success flag. More... | |
A file of GAFSorterRecords or GAF lines.
The records are sorted in increasing order by key. The object is movable but not copyable.
vg::GAFSorterFile::GAFSorterFile | ( | ) |
Default constructor that creates a compressed temporary file.
|
explicit |
Constructor that creates a raw GAF file with the given name.
vg::GAFSorterFile::~GAFSorterFile | ( | ) |
If the file is temporary, the destructor removes the file.
|
delete |
|
default |
|
inline |
Returns true if the file is actually stdin/stdout. In that case, open_input() should not be called.
std::pair< std::istream *, std::unique_ptr< std::istream > > vg::GAFSorterFile::open_input | ( | ) |
Returns an input stream to the file. The first return value is the actual stream. The second return value is a unique pointer which may contain a newly created stream. Sets the success flag.
std::pair< std::ostream *, std::unique_ptr< std::ostream > > vg::GAFSorterFile::open_output | ( | ) |
Returns an output stream to the file. The first return value is the actual stream. The second return value is a unique pointer which may contain a newly created stream. Sets the success flag.
|
delete |
|
default |
|
inline |
Reads the next record from the file, assuming that this is not a raw GAF file. Sets the success flag.
void vg::GAFSorterFile::remove_temporary | ( | ) |
Removes the file if it is temporary.
|
inline |
Writes the record to the file. Updates the number of records and sets the success flag.
bool vg::GAFSorterFile::compressed |
Is this file compressed?
std::string vg::GAFSorterFile::name |
File name.
bool vg::GAFSorterFile::ok |
Success flag.
bool vg::GAFSorterFile::raw_gaf |
Is this a raw GAF file?
size_t vg::GAFSorterFile::records |
Number of records.
bool vg::GAFSorterFile::removed |
Has the file been removed?
bool vg::GAFSorterFile::temporary |
Is this a temporary file created with temp_file::create()?