foobar2000 SDK  2015-08-03
Public Member Functions | Private Attributes
reader_bigmem_mirror

#include <filesystem_helper.h>

+ Inheritance diagram for reader_bigmem_mirror:

Public Member Functions

 reader_bigmem_mirror ()
 
bool get_content_type (pfc::string_base &p_out)
 
t_filetimestamp get_timestamp (abort_callback &p_abort)
 
void init (file::ptr source, abort_callback &abort)
 
bool is_remote ()
 
- Public Member Functions inherited from reader_bigmem
 reader_bigmem ()
 
bool can_seek ()
 
bool get_content_type (pfc::string_base &p_out)
 
t_filesize get_position (abort_callback &p_abort)
 
t_filesize get_size (abort_callback &p_abort)
 
t_filetimestamp get_timestamp (abort_callback &p_abort)
 
bool is_in_memory ()
 
bool is_remote ()
 
t_size read (void *p_buffer, t_size p_bytes, abort_callback &p_abort)
 
void read_object (void *p_buffer, t_size p_bytes, abort_callback &p_abort)
 
void reopen (abort_callback &p_abort)
 
void seek (t_filesize p_position, abort_callback &p_abort)
 
t_filesize skip (t_filesize p_bytes, abort_callback &p_abort)
 
void skip_object (t_filesize p_bytes, abort_callback &p_abort)
 

Private Attributes

pfc::string8 m_contentType
 
bool m_isRemote
 
t_filetimestamp m_ts
 

Additional Inherited Members

- Protected Member Functions inherited from reader_bigmem
size_t remaining () const
 
void resize (size_t newSize)
 
- Protected Attributes inherited from reader_bigmem
pfc::bigmem m_mem
 
size_t m_offset
 

Detailed Description

Definition at line 795 of file filesystem_helper.h.

Constructor & Destructor Documentation

reader_bigmem_mirror::reader_bigmem_mirror ( )
inline

Definition at line 797 of file filesystem_helper.h.

797 {}

Member Function Documentation

bool reader_bigmem_mirror::get_content_type ( pfc::string_base p_out)
inline

Definition at line 816 of file filesystem_helper.h.

816  {
817  if (m_contentType.is_empty()) return false;
818  p_out = m_contentType; return true;
819  }
bool is_empty() const
Definition: string_base.h:213
t_filetimestamp reader_bigmem_mirror::get_timestamp ( abort_callback p_abort)
inline

Definition at line 820 of file filesystem_helper.h.

820 {return m_ts;}
void reader_bigmem_mirror::init ( file::ptr  source,
abort_callback abort 
)
inline

Definition at line 799 of file filesystem_helper.h.

799  {
800  source->reopen(abort);
801  t_filesize fs = source->get_size(abort);
802  if (fs > 1024*1024*1024) { // reject > 1GB
803  throw std::bad_alloc();
804  }
805  size_t s = (size_t) fs;
806  resize(s);
807  for(size_t walk = 0; walk < m_mem._sliceCount(); ++walk) {
808  source->read( m_mem._slicePtr(walk), m_mem._sliceSize(walk), abort );
809  }
810 
811  if (!source->get_content_type( m_contentType ) ) m_contentType.reset();
812  m_isRemote = source->is_remote();
813  m_ts = source->get_timestamp( abort );
814  }
pfc::bigmem m_mem
size_t _sliceCount()
Definition: other.h:306
size_t _sliceSize(size_t which)
Definition: other.h:307
uint8_t * _slicePtr(size_t which)
Definition: other.h:305
void resize(size_t newSize)
t_uint64 t_filesize
Type used for file size related variables.
Definition: filesystem.h:8
bool reader_bigmem_mirror::is_remote ( )
inline

Definition at line 821 of file filesystem_helper.h.

821 {return m_isRemote;}

Field Documentation

pfc::string8 reader_bigmem_mirror::m_contentType
private

Definition at line 824 of file filesystem_helper.h.

bool reader_bigmem_mirror::m_isRemote
private

Definition at line 825 of file filesystem_helper.h.

t_filetimestamp reader_bigmem_mirror::m_ts
private

Definition at line 823 of file filesystem_helper.h.


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