GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
file_info Class Reference

#include "file-info.h"

Collaboration diagram for file_info:

Public Member Functions

 file_info (const file_info &)=default
 
 file_info (const std::string &fname)
 
 file_info (const std::string &text, const sys::time &timestamp)
 
 file_info (void)
 
 ~file_info (void)=default
 
OCTAVE_API std::string get_line (std::size_t line) const
 
OCTAVE_API std::deque< std::string > get_lines (std::size_t line, std::size_t num_lines) const
 
std::vector< std::size_t > line_offsets (void) const
 
std::size_t num_lines (void) const
 
file_infooperator= (const file_info &)=default
 
std::size_t size (void) const
 
std::string text (void) const
 
sys::time timestamp (void) const
 

Static Private Member Functions

static OCTAVE_API std::vector< std::size_t > get_line_offsets (const std::string &buf)
 
static OCTAVE_API std::string snarf_file (const std::string &fname)
 

Private Attributes

std::string m_file_buf
 
std::vector< std::size_t > m_offsets
 
sys::time m_timestamp
 

Detailed Description

Definition at line 40 of file file-info.h.

Constructor & Destructor Documentation

◆ file_info() [1/4]

file_info::file_info ( void  )
inline

Definition at line 44 of file file-info.h.

◆ file_info() [2/4]

file_info::file_info ( const std::string &  text,
const sys::time &  timestamp 
)
inline

Definition at line 48 of file file-info.h.

◆ file_info() [3/4]

file_info::file_info ( const std::string &  fname)
inline

Definition at line 53 of file file-info.h.

◆ file_info() [4/4]

file_info::file_info ( const file_info )
default

◆ ~file_info()

file_info::~file_info ( void  )
default

Member Function Documentation

◆ get_line()

std::string file_info::get_line ( std::size_t  line) const

Definition at line 40 of file file-info.cc.

Referenced by get_lines().

◆ get_line_offsets()

std::vector< std::size_t > file_info::get_line_offsets ( const std::string &  buf)
staticprivate

Definition at line 106 of file file-info.cc.

References len, and n.

◆ get_lines()

std::deque< std::string > file_info::get_lines ( std::size_t  line,
std::size_t  num_lines 
) const

Definition at line 63 of file file-info.cc.

References get_line(), and num_lines().

◆ line_offsets()

std::vector<std::size_t> file_info::line_offsets ( void  ) const
inline

Definition at line 74 of file file-info.h.

◆ num_lines()

std::size_t file_info::num_lines ( void  ) const
inline

Definition at line 70 of file file-info.h.

Referenced by get_lines().

◆ operator=()

file_info& file_info::operator= ( const file_info )
default

◆ size()

std::size_t file_info::size ( void  ) const
inline

Definition at line 78 of file file-info.h.

◆ snarf_file()

std::string file_info::snarf_file ( const std::string &  fname)
staticprivate

Definition at line 75 of file file-info.cc.

References ifstream().

◆ text()

std::string file_info::text ( void  ) const
inline

Definition at line 72 of file file-info.h.

◆ timestamp()

sys::time file_info::timestamp ( void  ) const
inline

Definition at line 76 of file file-info.h.

Member Data Documentation

◆ m_file_buf

std::string file_info::m_file_buf
private

Definition at line 83 of file file-info.h.

◆ m_offsets

std::vector<std::size_t> file_info::m_offsets
private

Definition at line 86 of file file-info.h.

◆ m_timestamp

sys::time file_info::m_timestamp
private

Definition at line 88 of file file-info.h.


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