#ifndef __IDATA_READER_H__
#define __IDATA_READER_H__

#include <unistd.h>

typedef struct IDataReader_s IDataReader;

struct IDataReader_s
{
    bool (*open) (IDataReader *instance, const char *uri);
    void (*close) (IDataReader *instance);
    bool (*read_exact) (IDataReader *instance, char *buf, size_t count);
    ssize_t (*read_bytes) (IDataReader *instance, char *buf, size_t count);
    bool (*peek_bytes) (IDataReader *instance, char *buf, size_t count);
    ssize_t (*seek_to_data) (IDataReader *instance, const char *needle, size_t count);
    ssize_t (*seek_to_data_func) (IDataReader *instance, size_t count, int (*) (const char *ptr));
    void (*destroy) (void *instance);
};


#endif
