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

Go to the source code of this file.

Classes

class  MythIOCallback
 

Macros

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

Functions

static int GetNextFileID (void)
 
void MythFileOpenRegisterCallback (const char *Pathname, void *Object, callback_t Func)
 
int MythFileCheck (int Id)
 
int MythFileOpen (const char *Pathname, int Flags)
 
int MythfileClose (int FileID)
 
off_t MythFileSeek (int FileID, off_t Offset, int Whence)
 
off_t MythFileTell (int FileID)
 
ssize_t MythFileRead (int FileID, void *Buffer, size_t Count)
 
ssize_t MythFileWrite (int FileID, void *Buffer, size_t Count)
 
int MythFileStat (const char *Path, struct stat *Buf)
 
int MythFileStatFD (int FileID, struct stat *Buf)
 
int MythFileExists (const char *Path, const char *File)
 
static int GetNextDirID (void)
 
int MythDirCheck (int DirID)
 
int MythDirOpen (const char *DirName)
 
int MythDirClose (int DirID)
 
char * MythDirRead (int DirID)
 

Variables

static const int s_maxID = 1024 * 1024
 
static QReadWriteLock s_fileWrapperLock
 
static QHash< int, MythMediaBuffer * > s_buffers
 
static QHash< int, RemoteFile * > s_remotefiles
 
static QHash< int, int > s_localfiles
 
static QHash< int, QString > s_filenames
 
static QReadWriteLock s_dirWrapperLock
 
static QHash< int, QStringList > s_remotedirs
 
static QHash< int, int > s_remotedirPositions
 
static QHash< int, QString > s_dirnames
 
static QHash< int, DIR * > s_localdirs
 
static QMutex s_callbackLock
 
static QMultiHash< QString, MythIOCallbacks_fileOpenCallbacks
 

Macro Definition Documentation

◆ LOC

#define LOC   QString("MythIOWrap: ")

Definition at line 62 of file mythiowrapper.cpp.

◆ lseek

#define lseek   _lseeki64

Definition at line 239 of file mythiowrapper.cpp.

◆ off_t

#define off_t   off64_t

Definition at line 241 of file mythiowrapper.cpp.

Function Documentation

◆ GetNextFileID()

static int GetNextFileID ( void  )
static

Definition at line 66 of file mythiowrapper.cpp.

Referenced by MythFileOpen().

◆ MythFileOpenRegisterCallback()

void MythFileOpenRegisterCallback ( const char *  Pathname,
void *  Object,
callback_t  Func 
)

Definition at line 81 of file mythiowrapper.cpp.

Referenced by MythBDBuffer::OpenFile().

◆ MythFileCheck()

int MythFileCheck ( int  Id)

Definition at line 108 of file mythiowrapper.cpp.

◆ MythFileOpen()

int MythFileOpen ( const char *  Pathname,
int  Flags 
)

◆ MythfileClose()

int MythfileClose ( int  FileID)

◆ MythFileSeek()

off_t MythFileSeek ( int  FileID,
off_t  Offset,
int  Whence 
)

Definition at line 243 of file mythiowrapper.cpp.

Referenced by BDRead(), MythBDFileSeek(), and MythBDInfo::MythBDInfo().

◆ MythFileTell()

off_t MythFileTell ( int  FileID)

Definition at line 262 of file mythiowrapper.cpp.

Referenced by MythBDFileTell().

◆ MythFileRead()

ssize_t MythFileRead ( int  FileID,
void *  Buffer,
size_t  Count 
)

◆ MythFileWrite()

ssize_t MythFileWrite ( int  FileID,
void *  Buffer,
size_t  Count 
)

Definition at line 304 of file mythiowrapper.cpp.

Referenced by MythBDFileWrite().

◆ MythFileStat()

int MythFileStat ( const char *  Path,
struct stat *  Buf 
)

◆ MythFileStatFD()

int MythFileStatFD ( int  FileID,
struct stat *  Buf 
)

Definition at line 338 of file mythiowrapper.cpp.

◆ MythFileExists()

int MythFileExists ( const char *  Path,
const char *  File 
)

Definition at line 359 of file mythiowrapper.cpp.

◆ GetNextDirID()

static int GetNextDirID ( void  )
static

Definition at line 372 of file mythiowrapper.cpp.

Referenced by MythDirOpen().

◆ MythDirCheck()

int MythDirCheck ( int  DirID)

Definition at line 386 of file mythiowrapper.cpp.

◆ MythDirOpen()

int MythDirOpen ( const char *  DirName)

Definition at line 395 of file mythiowrapper.cpp.

Referenced by MythBDDirOpen().

◆ MythDirClose()

int MythDirClose ( int  DirID)

Definition at line 447 of file mythiowrapper.cpp.

Referenced by MythBDDirClose().

◆ MythDirRead()

char* MythDirRead ( int  DirID)

Definition at line 470 of file mythiowrapper.cpp.

Referenced by MythBDDirRead().

Variable Documentation

◆ s_maxID

const int s_maxID = 1024 * 1024
static

Definition at line 45 of file mythiowrapper.cpp.

Referenced by GetNextDirID(), and GetNextFileID().

◆ s_fileWrapperLock

QReadWriteLock s_fileWrapperLock
static

◆ s_buffers

QHash<int, MythMediaBuffer*> s_buffers
static

◆ s_remotefiles

QHash<int, RemoteFile*> s_remotefiles
static

◆ s_localfiles

QHash<int, int> s_localfiles
static

◆ s_filenames

QHash<int, QString> s_filenames
static

Definition at line 51 of file mythiowrapper.cpp.

Referenced by MythFileOpen(), and MythFileStatFD().

◆ s_dirWrapperLock

QReadWriteLock s_dirWrapperLock
static

Definition at line 53 of file mythiowrapper.cpp.

Referenced by MythDirCheck(), MythDirClose(), MythDirOpen(), and MythDirRead().

◆ s_remotedirs

QHash<int, QStringList> s_remotedirs
static

Definition at line 54 of file mythiowrapper.cpp.

Referenced by GetNextDirID(), MythDirCheck(), MythDirClose(), MythDirOpen(), and MythDirRead().

◆ s_remotedirPositions

QHash<int, int> s_remotedirPositions
static

Definition at line 55 of file mythiowrapper.cpp.

Referenced by MythDirClose(), MythDirOpen(), and MythDirRead().

◆ s_dirnames

QHash<int, QString> s_dirnames
static

Definition at line 56 of file mythiowrapper.cpp.

Referenced by MythDirOpen().

◆ s_localdirs

QHash<int, DIR*> s_localdirs
static

Definition at line 57 of file mythiowrapper.cpp.

Referenced by GetNextDirID(), MythDirCheck(), MythDirClose(), MythDirOpen(), and MythDirRead().

◆ s_callbackLock

QMutex s_callbackLock
static

Definition at line 59 of file mythiowrapper.cpp.

Referenced by MythFileOpen(), and MythFileOpenRegisterCallback().

◆ s_fileOpenCallbacks

QMultiHash<QString, MythIOCallback> s_fileOpenCallbacks
static

Definition at line 60 of file mythiowrapper.cpp.

Referenced by MythFileOpen(), and MythFileOpenRegisterCallback().