Eliminate includes file and include locally as required.
This commit is contained in:
1 parent
be014d0d24
commit
91286649cc
10 files changed
+46
-38
No files matched your search
+16
-14
@@ -1,40 +1,42 @@
|
||||
#ifndef __DirectoryEntry_h__
|
||||
# define __DirectoryEntry_h__
|
||||
|
||||
# include "includes"
|
||||
#include <dirent.h>
|
||||
#include <string>
|
||||
#include <string.h>
|
||||
|
||||
namespace coreutils {
|
||||
|
||||
|
||||
class DirectoryEntry {
|
||||
|
||||
|
||||
public:
|
||||
DirectoryEntry(struct dirent *entry) {
|
||||
memcpy(&this->entry, entry, sizeof(struct dirent));
|
||||
memcpy(&this->entry, entry, sizeof(struct dirent));
|
||||
}
|
||||
|
||||
~DirectoryEntry() {}
|
||||
|
||||
|
||||
~DirectoryEntry() {}
|
||||
|
||||
std::string getName() {
|
||||
return std::string(entry.d_name);
|
||||
return std::string(entry.d_name);
|
||||
}
|
||||
|
||||
unsigned char getType() {
|
||||
return entry.d_type;
|
||||
return entry.d_type;
|
||||
}
|
||||
|
||||
|
||||
bool isFile() {
|
||||
return entry.d_type == DT_REG;
|
||||
}
|
||||
|
||||
|
||||
bool isDirectory() {
|
||||
return entry.d_type == DT_DIR;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
struct dirent entry;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user