Adaptyst
A comprehensive and architecture-agnostic performance analysis tool
Loading...
Searching...
No Matches
adaptyst::File Class Reference

#include <output.hpp>

Inheritance diagram for adaptyst::File:
adaptyst::ObjectWithMetadata adaptyst::Array< T >

Public Member Functions

 File (Path &path, std::string name, std::string extension="", bool truncate=true)
 
Fileoperator= (File &&source)
 
std::ifstream & get_istream ()
 
std::ofstream & get_ostream ()
 
void save_metadata ()
 

Protected Attributes

Pathpath
 
std::string name
 
std::ifstream istream
 
std::ofstream ostream
 

Detailed Description

This class represents a file with metadata attached to it (thanks to inheriting from ObjectFromMetadata) and saved separately.

Constructor & Destructor Documentation

◆ File()

adaptyst::File::File ( Path & path,
std::string name,
std::string extension = "",
bool truncate = true )
inline

Constructs a File object.

Parameters
pathPath to a directory where the file is.
nameName of the file without any extension.
extensionExtension of the file.
truncateWhether file contents should be truncated if the file already exists.

Member Function Documentation

◆ get_istream()

std::ifstream & adaptyst::File::get_istream ( )
inline

Gets an input stream corresponding to the file.

Returns
Input stream.

◆ get_ostream()

std::ofstream & adaptyst::File::get_ostream ( )
inline

Gets an output stream corresponding to the file.

Returns
Output stream.

◆ operator=()

File & adaptyst::File::operator= ( File && source)
inline

◆ save_metadata()

void adaptyst::File::save_metadata ( )
inlinevirtual

Saves metadata to disk, separately from the file itself.

Implements adaptyst::ObjectWithMetadata.

Member Data Documentation

◆ istream

std::ifstream adaptyst::File::istream
protected

◆ name

std::string adaptyst::File::name
protected

◆ ostream

std::ofstream adaptyst::File::ostream
protected

◆ path

Path& adaptyst::File::path
protected

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