MythTV  master
Classes | Macros | Functions | Variables
mythiowrapper.cpp File Reference
#include <windows.h>
#include <cstdio>
#include <dirent.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <QFile>
#include <QMap>
#include <QUrl>
#include <QReadWriteLock>
#include "mythconfig.h"
#include "compat.h"
#include "mythcorecontext.h"
#include "mythlogging.h"
#include "remotefile.h"
#include "ringbuffer.h"
#include "mythiowrapper.h"
Include dependency graph for mythiowrapper.cpp:

Go to the source code of this file.

Classes

class  Callback
 

Macros

#define LOC   QString("mythiowrapper: ")
 
#define lseek   _lseeki64
 
#define off_t   off64_t
 

Functions

static int getNextFileID (void)
 
void mythfile_open_register_callback (const char *pathname, void *object, callback_t func)
 
int mythfile_check (int id)
 
int mythfile_open (const char *pathname, int flags)
 
int mythfile_close (int fileID)
 
off_t mythfile_seek (int fileID, off_t offset, int whence)
 
off_t mythfile_tell (int fileID)
 
ssize_t mythfile_read (int fileID, void *buf, size_t count)
 
ssize_t mythfile_write (int fileID, void *buf, size_t count)
 
int mythfile_stat (const char *path, struct stat *buf)
 
int mythfile_stat_fd (int fileID, struct stat *buf)
 
int mythfile_exists (const char *path, const char *file)
 
static int getNextDirID (void)
 
int mythdir_check (int id)
 
int mythdir_opendir (const char *dirname)
 
int mythdir_closedir (int dirID)
 
char * mythdir_readdir (int dirID)
 

Variables

const int maxID = 1024 * 1024
 
QReadWriteLock m_fileWrapperLock
 
QHash< int, RingBuffer * > m_ringbuffers
 
QHash< int, RemoteFile * > m_remotefiles
 
QHash< int, int > m_localfiles
 
QHash< int, QString > m_filenames
 
QReadWriteLock m_dirWrapperLock
 
QHash< int, QStringList > m_remotedirs
 
QHash< int, int > m_remotedirPositions
 
QHash< int, QString > m_dirnames
 
QHash< int, DIR * > m_localdirs
 
QMutex m_callbackLock
 
QMultiHash< QString, Callbackm_fileOpenCallbacks
 

Macro Definition Documentation

◆ LOC

#define LOC   QString("mythiowrapper: ")

Definition at line 53 of file mythiowrapper.cpp.

◆ lseek

#define lseek   _lseeki64

Definition at line 259 of file mythiowrapper.cpp.

◆ off_t

#define off_t   off64_t

Definition at line 261 of file mythiowrapper.cpp.

Function Documentation

◆ getNextFileID()

static int getNextFileID ( void  )
static

Definition at line 59 of file mythiowrapper.cpp.

Referenced by mythfile_open().

◆ mythfile_open_register_callback()

void mythfile_open_register_callback ( const char *  pathname,
void *  object,
callback_t  func 
)

Definition at line 82 of file mythiowrapper.cpp.

Referenced by BDRingBuffer::OpenFile().

◆ mythfile_check()

int mythfile_check ( int  id)

Definition at line 119 of file mythiowrapper.cpp.

◆ mythfile_open()

int mythfile_open ( const char *  pathname,
int  flags 
)

◆ mythfile_close()

int mythfile_close ( int  fileID)

◆ mythfile_seek()

off_t mythfile_seek ( int  fileID,
off_t  offset,
int  whence 
)

Definition at line 263 of file mythiowrapper.cpp.

Referenced by _img_read(), and file_seek_mythiowrapper().

◆ mythfile_tell()

off_t mythfile_tell ( int  fileID)

Definition at line 282 of file mythiowrapper.cpp.

Referenced by file_tell_mythiowrapper().

◆ mythfile_read()

ssize_t mythfile_read ( int  fileID,
void *  buf,
size_t  count 
)

◆ mythfile_write()

ssize_t mythfile_write ( int  fileID,
void *  buf,
size_t  count 
)

Definition at line 323 of file mythiowrapper.cpp.

Referenced by file_write_mythiowrapper().

◆ mythfile_stat()

int mythfile_stat ( const char *  path,
struct stat *  buf 
)

◆ mythfile_stat_fd()

int mythfile_stat_fd ( int  fileID,
struct stat *  buf 
)

Definition at line 357 of file mythiowrapper.cpp.

◆ mythfile_exists()

int mythfile_exists ( const char *  path,
const char *  file 
)

Definition at line 374 of file mythiowrapper.cpp.

◆ getNextDirID()

static int getNextDirID ( void  )
static

Definition at line 387 of file mythiowrapper.cpp.

Referenced by mythdir_opendir().

◆ mythdir_check()

int mythdir_check ( int  id)

Definition at line 406 of file mythiowrapper.cpp.

◆ mythdir_opendir()

int mythdir_opendir ( const char *  dirname)

Definition at line 421 of file mythiowrapper.cpp.

Referenced by dir_open_mythiowrapper().

◆ mythdir_closedir()

int mythdir_closedir ( int  dirID)

Definition at line 476 of file mythiowrapper.cpp.

Referenced by dir_close_mythiowrapper().

◆ mythdir_readdir()

char* mythdir_readdir ( int  dirID)

Definition at line 501 of file mythiowrapper.cpp.

Referenced by dir_read_mythiowrapper().

Variable Documentation

◆ maxID

const int maxID = 1024 * 1024

Definition at line 27 of file mythiowrapper.cpp.

Referenced by getNextDirID(), and getNextFileID().

◆ m_fileWrapperLock

QReadWriteLock m_fileWrapperLock

◆ m_ringbuffers

QHash<int, RingBuffer *> m_ringbuffers

◆ m_remotefiles

QHash<int, RemoteFile *> m_remotefiles

◆ m_localfiles

QHash<int, int> m_localfiles

◆ m_filenames

QHash<int, QString> m_filenames

Definition at line 33 of file mythiowrapper.cpp.

Referenced by mythfile_open(), and mythfile_stat_fd().

◆ m_dirWrapperLock

QReadWriteLock m_dirWrapperLock

◆ m_remotedirs

QHash<int, QStringList> m_remotedirs

◆ m_remotedirPositions

QHash<int, int> m_remotedirPositions

Definition at line 37 of file mythiowrapper.cpp.

Referenced by mythdir_closedir(), mythdir_opendir(), and mythdir_readdir().

◆ m_dirnames

QHash<int, QString> m_dirnames

Definition at line 38 of file mythiowrapper.cpp.

Referenced by mythdir_opendir().

◆ m_localdirs

QHash<int, DIR *> m_localdirs

◆ m_callbackLock

QMutex m_callbackLock

Definition at line 50 of file mythiowrapper.cpp.

Referenced by mythfile_open(), and mythfile_open_register_callback().

◆ m_fileOpenCallbacks

QMultiHash<QString, Callback> m_fileOpenCallbacks

Definition at line 51 of file mythiowrapper.cpp.

Referenced by mythfile_open(), and mythfile_open_register_callback().