file: Add doxygen documentation

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2014-09-16 08:22:34 -04:00
parent 0626141f7f
commit 7bde6d98aa
2 changed files with 52 additions and 2 deletions

View File

@ -1,4 +1,5 @@
/*
/**
* @file
* Copyright 2013 (c) Anna Schumaker.
*/
#include <core/file.h>

View File

@ -1,4 +1,5 @@
/*
/**
* @file
* Copyright 2013 (c) Anna Schumaker.
*/
#ifndef OCARINA_CORE_FILE_H
@ -8,13 +9,24 @@
#include <string>
/**
* Enum for how files could be open.
*/
enum OpenMode {
/** File is open for reading. */
OPEN_READ,
/** File is open for writing. */
OPEN_WRITE,
/** File is not open. */
NOT_OPEN,
};
/**
* Class for modifying files in the Ocarina directory.
*/
class File : public std::fstream {
private:
OpenMode mode;
@ -28,13 +40,50 @@ private:
public:
/**
* Set up a new file object.
*
* @param name The name of the file.
* @param version The file version of the new file.
*/
File(const std::string &, unsigned int);
/**
* File class destructor.
*/
~File();
/**
* @return The full filepath of the file.
*/
const std::string get_filepath();
/**
* @return The version number of the file.
*/
const unsigned int get_version();
/**
* @return True if the file exists on disk, False otherwise.
*/
bool exists();
/**
* Open a file.
*
* @param mode How the file should be opened.
* @return True if the open succeeded, False otherwise.
*/
bool open(OpenMode);
/**
* Close an open file.
*/
void close();
/**
* @return A string containing the rest of the line.
*/
std::string getline();
};