foobar2000 SDK  2015-08-03
Data Structures | Enumerations | Functions
input_impl.h File Reference

Go to the source code of this file.

Data Structures

class  input_entry_impl_t< I, t_flags, t_decoder, t_inforeader, t_infowriter >
 
class  input_factory_ex_t< T, t_flags, t_decoder, t_inforeader, t_infowriter >
 
class  input_factory_t< T >
 
class  input_impl
 
class  input_impl_interface_wrapper_t< I, t_base >
 
class  input_singletrack_factory_ex_t< T, t_flags, t_decoder, t_inforeader, t_infowriter >
 
class  input_singletrack_factory_t< T >
 
class  input_singletrack_impl
 
class  input_wrapper_singletrack_t< I >
 

Enumerations

enum  t_input_open_reason { input_open_info_read, input_open_decode, input_open_info_write }
 

Functions

void input_open_file_helper (service_ptr_t< file > &p_file, const char *p_path, t_input_open_reason p_reason, abort_callback &p_abort)
 

Enumeration Type Documentation

Enumerator
input_open_info_read 
input_open_decode 
input_open_info_write 

Definition at line 1 of file input_impl.h.

Function Documentation

void input_open_file_helper ( service_ptr_t< file > &  p_file,
const char *  p_path,
t_input_open_reason  p_reason,
abort_callback p_abort 
)

Helper function for input implementation use; ensures that file is open with relevant access mode. This is typically called from input_impl::open() and such.

Parameters
p_fileFile object pointer to process. If passed pointer is non-null, the function does nothing and always succeeds; otherwise it attempts to open the file using filesystem API methods.
p_pathPath to the file.
p_reasonType of input operation requested. See: input_impl::open() parameters.
p_abortabort_callback object signaling user aborting the operation.

Definition at line 231 of file input.cpp.

232 {
233  if (p_file.is_empty()) {
234  switch(p_reason) {
235  default:
236  uBugCheck();
238  case input_open_decode:
239  filesystem::g_open(p_file,p_path,filesystem::open_mode_read,p_abort);
240  break;
242  filesystem::g_open(p_file,p_path,filesystem::open_mode_write_existing,p_abort);
243  break;
244  }
245  } else {
246  p_file->reopen(p_abort);
247  }
248 }
bool is_empty() const
Definition: service.h:120
PFC_NORETURN void SHARED_EXPORT uBugCheck()