view src/console/Vfs_File.h @ 2152:8a5231ff9c4f

- Use a single lock for the ring buffer and the condition variable
author Ralf Ertzinger <ralf@skytale.net>
date Sun, 04 Nov 2007 14:05:16 +0100
parents 839804c3b3a4
children 3134a0987162
line wrap: on
line source

// File_Reader wrapper over a VFSFile

#ifndef VFS_FILE_H
#define VFS_FILE_H

#include "Data_Reader.h"

#include <audacious/plugin.h>

class Vfs_File_Reader : public File_Reader {
public:
	void reset( VFSFile* ); // use already-open file and doesn't close it in close()
	error_t open( const char* path );
	VFSFile* file() const { return file_; }
	void close();
	
public:
	Vfs_File_Reader();
	~Vfs_File_Reader();
	long size() const;
	long read_avail( void*, long );
	long tell() const;
	error_t seek( long );
private:
	VFSFile* file_;
	VFSFile* owned_file_;
};

#endif