* Fix Wii/GC Compiling

* Initial FileInfo/Dir APIs
* Get rid of type punning warnings
This commit is contained in:
2015-05-18 14:03:13 -07:00
parent 20e12b86ca
commit d5ccf159f7
26 changed files with 3251 additions and 65 deletions

34
include/Athena/Dir.hpp Normal file
View File

@@ -0,0 +1,34 @@
#ifndef DIR_HPP
#define DIR_HPP
#include "Athena/FileInfo.hpp"
#include <stdio.h>
namespace Athena
{
class Dir
{
public:
explicit Dir(const std::string& path);
std::string absolutePath() const;
static inline std::string absolutePath(const std::string& path)
{ return Dir(path).absolutePath(); }
bool isDir() const;
static bool isDir(const std::string dir)
{ return Dir(dir).isDir(); }
std::vector<FileInfo> files() const;
bool cd(const std::string& path);
bool rm(const std::string& path);
bool touch();
static bool mkdir(const std::string& dir, mode_t mode = 0755);
static bool mkpath(const std::string& path, mode_t mode = 0755);
private:
std::string m_path;
};
}
#endif // DIR_HPP