mirror of
https://github.com/libAthena/athena.git
synced 2025-12-09 05:27:50 +00:00
* Fix Wii/GC Compiling
* Initial FileInfo/Dir APIs * Get rid of type punning warnings
This commit is contained in:
34
include/Athena/Dir.hpp
Normal file
34
include/Athena/Dir.hpp
Normal 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
|
||||
Reference in New Issue
Block a user