ocarina/include/file.h
Anna Schumaker a96e6f6f2d file: Set version number on a per-file basis
I'm about to bump the version number for the deck layer, so it makes
senes that different files need different version numbers.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
2014-05-26 12:14:28 -04:00

42 lines
634 B
C++

/*
* Copyright 2013 (c) Anna Schumaker.
*/
#ifndef OCARINA_FILE_H
#define OCARINA_FILE_H
#include <fstream>
#include <string>
enum OpenMode {
OPEN_READ,
OPEN_WRITE,
NOT_OPEN,
};
class File : public std::fstream {
private:
OpenMode mode;
std::string filename;
unsigned int version;
unsigned int prev_version;
const std::string find_dir();
bool open_read();
bool open_write();
public:
File(const std::string &, unsigned int);
~File();
const std::string get_filepath();
const unsigned int get_version();
bool exists();
bool open(OpenMode);
void close();
std::string getline();
};
#endif /* OCARINA_FILE_H */