file: Add doxygen documentation
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
0626141f7f
commit
7bde6d98aa
|
@ -1,4 +1,5 @@
|
||||||
/*
|
/**
|
||||||
|
* @file
|
||||||
* Copyright 2013 (c) Anna Schumaker.
|
* Copyright 2013 (c) Anna Schumaker.
|
||||||
*/
|
*/
|
||||||
#include <core/file.h>
|
#include <core/file.h>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/*
|
/**
|
||||||
|
* @file
|
||||||
* Copyright 2013 (c) Anna Schumaker.
|
* Copyright 2013 (c) Anna Schumaker.
|
||||||
*/
|
*/
|
||||||
#ifndef OCARINA_CORE_FILE_H
|
#ifndef OCARINA_CORE_FILE_H
|
||||||
|
@ -8,13 +9,24 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enum for how files could be open.
|
||||||
|
*/
|
||||||
enum OpenMode {
|
enum OpenMode {
|
||||||
|
/** File is open for reading. */
|
||||||
OPEN_READ,
|
OPEN_READ,
|
||||||
|
|
||||||
|
/** File is open for writing. */
|
||||||
OPEN_WRITE,
|
OPEN_WRITE,
|
||||||
|
|
||||||
|
/** File is not open. */
|
||||||
NOT_OPEN,
|
NOT_OPEN,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class for modifying files in the Ocarina directory.
|
||||||
|
*/
|
||||||
class File : public std::fstream {
|
class File : public std::fstream {
|
||||||
private:
|
private:
|
||||||
OpenMode mode;
|
OpenMode mode;
|
||||||
|
@ -28,13 +40,50 @@ private:
|
||||||
|
|
||||||
public:
|
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(const std::string &, unsigned int);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File class destructor.
|
||||||
|
*/
|
||||||
~File();
|
~File();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The full filepath of the file.
|
||||||
|
*/
|
||||||
const std::string get_filepath();
|
const std::string get_filepath();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The version number of the file.
|
||||||
|
*/
|
||||||
const unsigned int get_version();
|
const unsigned int get_version();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return True if the file exists on disk, False otherwise.
|
||||||
|
*/
|
||||||
bool exists();
|
bool exists();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a file.
|
||||||
|
*
|
||||||
|
* @param mode How the file should be opened.
|
||||||
|
* @return True if the open succeeded, False otherwise.
|
||||||
|
*/
|
||||||
bool open(OpenMode);
|
bool open(OpenMode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close an open file.
|
||||||
|
*/
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return A string containing the rest of the line.
|
||||||
|
*/
|
||||||
std::string getline();
|
std::string getline();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue