A library for working with phylogenetic data.
v0.25.0
HtsFile Class Reference

#include <genesis/population/formats/hts_file.hpp>

Detailed Description

Wrap an ::htsFile struct.

This thin wrapper simply applies RAII to the htslib struct.

Definition at line 56 of file hts_file.hpp.

Public Member Functions

 HtsFile ()=default
 Create an empty instance, with no file attached. More...
 
 HtsFile (HtsFile &&other)
 
 HtsFile (HtsFile const &)=delete
 
 HtsFile (std::string const &file_name, std::string const &mode="r")
 Create an instance that opens a file. More...
 
 ~HtsFile ()
 
::htsFile * data ()
 
std::string const & file_name () const
 
std::string format_description () const
 Return a human-readable description of the file format. More...
 
std::string format_extension () const
 Return the file format extension. More...
 
HtsFileoperator= (HtsFile &&other)
 
HtsFileoperator= (HtsFile const &)=delete
 

Constructor & Destructor Documentation

◆ HtsFile() [1/4]

HtsFile ( )
default

Create an empty instance, with no file attached.

◆ HtsFile() [2/4]

HtsFile ( std::string const &  file_name,
std::string const &  mode = "r" 
)
explicit

Create an instance that opens a file.

For the mode param, see the ::hts_open() documentation of htslib. By default, we open for read-only access.

Definition at line 49 of file hts_file.cpp.

◆ ~HtsFile()

~HtsFile ( )

Definition at line 62 of file hts_file.cpp.

◆ HtsFile() [3/4]

HtsFile ( HtsFile const &  )
delete

◆ HtsFile() [4/4]

HtsFile ( HtsFile &&  other)

Definition at line 69 of file hts_file.cpp.

Member Function Documentation

◆ data()

::htsFile* data ( )
inline

Definition at line 97 of file hts_file.hpp.

◆ file_name()

std::string const& file_name ( ) const
inline

Definition at line 92 of file hts_file.hpp.

◆ format_description()

std::string format_description ( ) const

Return a human-readable description of the file format.

See the ::hts_format_description() documentation of htslib for details.

Definition at line 95 of file hts_file.cpp.

◆ format_extension()

std::string format_extension ( ) const

Return the file format extension.

See the ::hts_format_file_extension() documentation of htslib for details.

Definition at line 104 of file hts_file.cpp.

◆ operator=() [1/2]

HtsFile & operator= ( HtsFile &&  other)

Definition at line 79 of file hts_file.cpp.

◆ operator=() [2/2]

HtsFile& operator= ( HtsFile const &  )
delete

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