2003-05-22 17:54:43 +00:00
|
|
|
/*
|
|
|
|
mkvmerge -- utility for splicing together matroska files
|
|
|
|
from component media subtypes
|
|
|
|
|
2003-05-23 06:34:58 +00:00
|
|
|
mm_io_c.h
|
2003-05-22 17:54:43 +00:00
|
|
|
|
|
|
|
Written by Moritz Bunkus <moritz@bunkus.org>
|
|
|
|
|
|
|
|
Distributed under the GPL
|
|
|
|
see the file COPYING for details
|
|
|
|
or visit http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\file
|
2003-05-23 09:51:22 +00:00
|
|
|
\version \$Id: mm_io.h,v 1.3 2003/05/23 09:51:22 mosu Exp $
|
2003-05-22 17:54:43 +00:00
|
|
|
\brief IO callback class definitions
|
|
|
|
\author Moritz Bunkus <moritz@bunkus.org>
|
|
|
|
*/
|
|
|
|
|
2003-05-23 06:34:58 +00:00
|
|
|
#ifndef __MM_IO_H
|
|
|
|
#define __MM_IO_H
|
2003-05-22 17:54:43 +00:00
|
|
|
|
2003-05-23 09:51:22 +00:00
|
|
|
#ifndef __CYGWIN__
|
2003-05-22 17:54:43 +00:00
|
|
|
#include <stdint.h>
|
2003-05-23 09:51:22 +00:00
|
|
|
#endif // __CYGWIN__
|
2003-05-22 17:54:43 +00:00
|
|
|
|
|
|
|
#include "IOCallback.h"
|
|
|
|
|
|
|
|
using namespace LIBEBML_NAMESPACE;
|
|
|
|
|
2003-05-23 06:34:58 +00:00
|
|
|
class mm_io_c: public IOCallback {
|
2003-05-23 09:51:22 +00:00
|
|
|
void *file;
|
2003-05-22 17:54:43 +00:00
|
|
|
|
|
|
|
public:
|
2003-05-23 06:34:58 +00:00
|
|
|
mm_io_c(const char *path, const open_mode mode);
|
|
|
|
virtual ~mm_io_c();
|
2003-05-22 17:54:43 +00:00
|
|
|
|
|
|
|
virtual uint64 getFilePointer();
|
|
|
|
virtual void setFilePointer(int64 offset, seek_mode mode=seek_beginning);
|
|
|
|
virtual uint32 read(void *buffer, size_t size);
|
|
|
|
virtual size_t write(const void *buffer, size_t size);
|
|
|
|
virtual void close();
|
2003-05-23 06:34:58 +00:00
|
|
|
virtual bool eof();
|
|
|
|
virtual char *gets(char *buffer, size_t max_size);
|
2003-05-22 17:54:43 +00:00
|
|
|
};
|
|
|
|
|
2003-05-23 09:51:22 +00:00
|
|
|
class mm_null_io_c: public IOCallback {
|
2003-05-22 17:54:43 +00:00
|
|
|
protected:
|
|
|
|
int64_t pos;
|
|
|
|
|
|
|
|
public:
|
2003-05-23 09:51:22 +00:00
|
|
|
mm_null_io_c();
|
2003-05-22 17:54:43 +00:00
|
|
|
|
|
|
|
virtual uint64 getFilePointer();
|
|
|
|
virtual void setFilePointer(int64 offset, seek_mode mode=seek_beginning);
|
|
|
|
virtual uint32 read(void *buffer, size_t size);
|
|
|
|
virtual size_t write(const void *buffer, size_t size);
|
|
|
|
virtual void close();
|
|
|
|
};
|
|
|
|
|
2003-05-23 06:34:58 +00:00
|
|
|
#endif // __MM_IO_H
|