foobar2000 SDK  2015-08-03
Data Structures | Public Member Functions | Static Private Member Functions | Private Attributes
foobar2000_io::directory_callback_impl

#include <filesystem.h>

+ Inheritance diagram for foobar2000_io::directory_callback_impl:

Data Structures

struct  t_entry
 

Public Member Functions

 directory_callback_impl (bool p_recur)
 
t_size get_count ()
 
const char * get_item (t_size n) const
 
const t_filestatsget_item_stats (t_size n) const
 
bool on_entry (filesystem *owner, abort_callback &p_abort, const char *url, bool is_subdirectory, const t_filestats &p_stats)
 
const char * operator[] (t_size n) const
 
void sort ()
 

Static Private Member Functions

static int sortfunc (const pfc::rcptr_t< const t_entry > &p1, const pfc::rcptr_t< const t_entry > &p2)
 

Private Attributes

pfc::list_t< pfc::rcptr_t< t_entry > > m_data
 
bool m_recur
 

Detailed Description

Definition at line 486 of file filesystem.h.

Constructor & Destructor Documentation

foobar2000_io::directory_callback_impl::directory_callback_impl ( bool  p_recur)
inline

Definition at line 503 of file filesystem.h.

Member Function Documentation

t_size foobar2000_io::directory_callback_impl::get_count ( )
inline

Definition at line 504 of file filesystem.h.

504 {return m_data.get_count();}
pfc::list_t< pfc::rcptr_t< t_entry > > m_data
Definition: filesystem.h:496
const char* foobar2000_io::directory_callback_impl::get_item ( t_size  n) const
inline

Definition at line 506 of file filesystem.h.

506 {return m_data[n]->m_path;}
pfc::list_t< pfc::rcptr_t< t_entry > > m_data
Definition: filesystem.h:496
const t_filestats& foobar2000_io::directory_callback_impl::get_item_stats ( t_size  n) const
inline

Definition at line 507 of file filesystem.h.

507 {return m_data[n]->m_stats;}
pfc::list_t< pfc::rcptr_t< t_entry > > m_data
Definition: filesystem.h:496
bool directory_callback_impl::on_entry ( filesystem p_owner,
abort_callback p_abort,
const char *  p_url,
bool  p_is_subdirectory,
const t_filestats p_stats 
)
virtual
Returns
true to continue enumeration, false to abort.

Implements foobar2000_io::directory_callback.

Definition at line 488 of file filesystem.cpp.

488  {
489  p_abort.check_e();
490  if (is_subdirectory) {
491  if (m_recur) {
492  try {
493  owner->list_directory(url,*this,p_abort);
494  } catch(exception_io const &) {}
495  }
496  } else {
497  m_data.add_item(pfc::rcnew_t<t_entry>(url,p_stats));
498  }
499  return true;
500 }
pfc::list_t< pfc::rcptr_t< t_entry > > m_data
Definition: filesystem.h:496
const char* foobar2000_io::directory_callback_impl::operator[] ( t_size  n) const
inline

Definition at line 505 of file filesystem.h.

505 {return m_data[n]->m_path;}
pfc::list_t< pfc::rcptr_t< t_entry > > m_data
Definition: filesystem.h:496
void foobar2000_io::directory_callback_impl::sort ( )
inline

Definition at line 508 of file filesystem.h.

508 {m_data.sort_t(sortfunc);}
static int sortfunc(const pfc::rcptr_t< const t_entry > &p1, const pfc::rcptr_t< const t_entry > &p2)
Definition: filesystem.h:499
pfc::list_t< pfc::rcptr_t< t_entry > > m_data
Definition: filesystem.h:496
static int foobar2000_io::directory_callback_impl::sortfunc ( const pfc::rcptr_t< const t_entry > &  p1,
const pfc::rcptr_t< const t_entry > &  p2 
)
inlinestaticprivate

Definition at line 499 of file filesystem.h.

499 {return pfc::io::path::compare(p1->m_path,p2->m_path);}
pfc::string_simple m_path
Definition: filesystem.h:490
int compare(t1 const &p1, t2 const &p2)
Definition: pathUtils.h:29

Field Documentation

pfc::list_t<pfc::rcptr_t<t_entry> > foobar2000_io::directory_callback_impl::m_data
private

Definition at line 496 of file filesystem.h.

bool foobar2000_io::directory_callback_impl::m_recur
private

Definition at line 497 of file filesystem.h.


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