01.03.2011 - as a initial commit
This commit is contained in:
42
pidir.h
Normal file
42
pidir.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef PIDIR_H
|
||||
#define PIDIR_H
|
||||
|
||||
#include "pifile.h"
|
||||
#include <sys/dir.h>
|
||||
|
||||
class PIDir
|
||||
{
|
||||
public:
|
||||
PIDir() {dir_ = 0;}
|
||||
PIDir(const PIString & dir);
|
||||
~PIDir() {close();}
|
||||
|
||||
inline const bool isExists() {return (dir_ != 0);}
|
||||
inline PIString path() {return PIString(path_);}
|
||||
PIString absolutePath();
|
||||
|
||||
bool operator ==(const PIDir & d) const;
|
||||
|
||||
#ifdef WINDOWS
|
||||
static const char separator = '\\';
|
||||
#else
|
||||
static const char separator = '/';
|
||||
#endif
|
||||
|
||||
static PIDir current();
|
||||
static PIDir home();
|
||||
static PIDir temporary();
|
||||
static bool mkDir(const PIString & path);
|
||||
static bool rmDir(const PIString & path);
|
||||
//static bool rmDir(const PIString & path);
|
||||
|
||||
private:
|
||||
bool open();
|
||||
bool close();
|
||||
|
||||
string path_;
|
||||
DIR * dir_;
|
||||
|
||||
};
|
||||
|
||||
#endif // PIDIR_H
|
||||
Reference in New Issue
Block a user