foobar2000 SDK  2015-01-14
fullFileBuffer.h
Go to the documentation of this file.
2 public:
4  //hMutex = CreateMutex(NULL, FALSE, pfc::stringcvt::string_os_from_utf8(pfc::string_formatter() << "{3ABC4D98-2510-431C-A720-26BEB45F0278}-" << (uint32_t) GetCurrentProcessId()));
5  }
7  //CloseHandle(hMutex);
8  }
9  file::ptr open(const char * path, abort_callback & abort, file::ptr hint, t_filesize sizeMax = 1024*1024*256) {
10  //mutexScope scope(hMutex, abort);
11 
12  file::ptr f;
13  if (hint.is_valid()) f = hint;
14  else filesystem::g_open_read( f, path, abort );
15  t_filesize fs = f->get_size(abort);
16  if (fs < sizeMax) /*rejects size-unknown too*/ {
17  try {
19  r->init( f, abort );
20  f = r;
21  } catch(std::bad_alloc) {}
22  }
23  return f;
24  }
25 
26 private:
28  void operator=(const fullFileBuffer&);
29 
30  //HANDLE hMutex;
31 };
Template implementing reference-counting features of service_base. Intended for dynamic instantiation...
Definition: service_impl.h:4
void operator=(const fullFileBuffer &)
t_uint64 t_filesize
Type used for file size related variables.
Definition: filesystem.h:8
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
file::ptr open(const char *path, abort_callback &abort, file::ptr hint, t_filesize sizeMax=1024 *1024 *256)
Definition: fullFileBuffer.h:9