22 #ifndef DBA_CORE_FILE_H
23 #define DBA_CORE_FILE_H
59 File(
const std::string&
name, FILE* fd,
bool close_on_exit=
true);
73 const std::string&
name()
const throw () {
return m_name; }
81 virtual Encoding
type()
const throw () = 0;
117 static std::auto_ptr<
File>
create(Encoding
type, const std::
string&
name, const
char* mode);
FILE * fd
FILE structure used to read or write to the file.
Definition: file.h:52
virtual void write(const Rawmsg &msg)
Write the encoded message data to the file.
static std::auto_ptr< File > create(Encoding type, const std::string &name, const char *mode)
Create a dba_file structure.
std::string m_name
Name of the file.
Definition: file.h:50
virtual bool read(Rawmsg &msg)=0
Read a message from the file.
int idx
Index of the last message read from the file or written to the file.
Definition: file.h:56
const std::string & name() const
Get the type of the dba_file.
Definition: file.h:73
Annotated string buffer for encoded messages.
Definition: rawmsg.h:38
FILE * stream() const
Get the file stream.
Definition: file.h:65
virtual Encoding type() const =0
Get the name of the dba_file.
bool close_on_exit
Set to true if fd should be closed when dba_file_delete() is called.
Definition: file.h:54