11#define WIN32_LEAN_AND_MEAN
12#define NOWINBASEINTERLOCK
18#if defined(__linux__) || defined(__darwin__) || defined(__APPLE__) || defined(BSD) || defined(__sun)
31 if (!
dll_handle) { printf(
"Error while loading library %s. Error code %i\n", libname.c_str(), GetLastError());
m_reader =
nullptr;
return; }
32 typedef Reader* (__stdcall *f_funci)(std::istream & stream);
33 f_funci newReader = (f_funci)GetProcAddress((HINSTANCE)(
dll_handle), newreader.c_str());
34 if (!newReader) { printf(
"Error while loading function %s from library %s. Error code %i\n", newreader.c_str(), libname.c_str(), GetLastError());
m_reader =
nullptr;
return; }
38#if defined(__linux__) || defined(__darwin__) || defined(__APPLE__) || defined(BSD) || defined(__sun)
39 dll_handle = dlopen(libname.c_str(), RTLD_LAZY | RTLD_GLOBAL);
40 if (!
dll_handle) { printf(
"Error while loading library %s: %s\n", libname.c_str(), dlerror());
m_reader =
nullptr;
return; }
41 using f_funci =
Reader *(*)(std::istream &);
42 auto newReader = (f_funci)dlsym(
dll_handle, newreader.c_str());
43 if (!newReader) { printf(
"Error while loading function %s from library %s: %s\n", newreader.c_str(), libname.c_str(), dlerror());
m_reader =
nullptr;
return; }
51 if (!
dll_handle) { printf(
"Error while loading library %s. Error code %i\n", libname.c_str(), GetLastError());
m_reader =
nullptr;
return; }
52 typedef Reader* (__stdcall *f_funci)(
const std::string&);
53 f_funci newReader = (f_funci)GetProcAddress((HINSTANCE)(
dll_handle), newreader.c_str());
54 if (!newReader) { printf(
"Error while loading function %s from library %s. Error code %i\n", newreader.c_str(), libname.c_str(), GetLastError());
m_reader =
nullptr;
return; }
58#if defined(__linux__) || defined(__darwin__) || defined(__APPLE__) || defined(BSD) || defined(__sun)
59 dll_handle = dlopen(libname.c_str(), RTLD_LAZY | RTLD_GLOBAL);
60 if (!
dll_handle) { printf(
"Error while loading library %s: %s\n", libname.c_str(), dlerror());
m_reader =
nullptr;
return; }
61 using f_funci =
Reader *(*)(
const std::string&);
62 auto newReader = (f_funci)dlsym(
dll_handle, newreader.c_str());
63 if (!newReader) { printf(
"Error while loading function %s from library %s: %s\n", newreader.c_str(), libname.c_str(), dlerror());
m_reader =
nullptr;
return; }
75#if defined(__linux__) || defined(__darwin__) || defined(__APPLE__) || defined(BSD) || defined(__sun)
Definition of class GenEvent.
Definition of class ReaderPlugin.
ReaderPlugin(std::istream &stream, const std::string &libname, const std::string &newreader)
Constructor to read from stream.
~ReaderPlugin() override
Destructor.
Reader * m_reader
The actual reader.
void * dll_handle
library handler
Base class for all I/O readers.
virtual void close()=0
Close file and/or stream.