Adding Spectre/System/Log/FileWriter class.
This commit is contained in:
parent
173aea31c9
commit
8db01a0957
3 changed files with 97 additions and 0 deletions
30
include/Spectre/System/Log/FileWriter.h
Normal file
30
include/Spectre/System/Log/FileWriter.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef SPECTRE_SYSTEM_LOG_FILEWRITER_H
|
||||
#define SPECTRE_SYSTEM_LOG_FILEWRITER_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <Spectre/System/Log/Writer.h>
|
||||
|
||||
namespace sp { namespace log {
|
||||
|
||||
class FileWriter : public Writer
|
||||
{
|
||||
public:
|
||||
FileWriter(const std::string file = "");
|
||||
~FileWriter();
|
||||
|
||||
bool open(const std::string file);
|
||||
|
||||
bool close();
|
||||
|
||||
size_t write(const void *data, size_t len);
|
||||
|
||||
protected:
|
||||
|
||||
FILE *m_fd;
|
||||
};
|
||||
|
||||
|
||||
} } // sp::log
|
||||
|
||||
#endif /* SPECTRE_SYSTEM_LOG_FILEWRITER_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue