First version of DTSC::File for easy management of DTSC files.

This commit is contained in:
Thulinma 2012-08-23 11:08:39 +02:00
parent 0c5f449963
commit 8a9d4d6ee1
2 changed files with 115 additions and 1 deletions

View file

@ -8,6 +8,7 @@
#include <string>
#include <deque>
#include <set>
#include <stdio.h> //for FILE
@ -102,6 +103,22 @@ namespace DTSC{
extern char Magic_Header[]; ///< The magic bytes for a DTSC header
extern char Magic_Packet[]; ///< The magic bytes for a DTSC packet
/// A simple wrapper class that will open a file and allow easy reading/writing of DTSC data from/to it.
class File{
public:
File(std::string filename, bool create = false);
~File();
std::string & getHeader();
bool writeHeader(std::string & header, bool force = false);
std::string & getPacket();
private:
std::string strbuffer;
FILE * F;
long headerSize;
char buffer[4];
};//FileWriter
/// A part from the DTSC::Stream ringbuffer.
/// Holds information about a buffer that will stay consistent
class Ring {