Unix compatibility for UD 0.1.0

- a few naming changes and then the release, yay
This commit is contained in:
Nikolaj Schlej 2016-07-09 08:50:34 +02:00
parent 7bae8e040c
commit 80b85cbf19
2 changed files with 16 additions and 2 deletions

View File

@ -17,11 +17,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <sys/stat.h>
#ifdef WIN32 #ifdef WIN32
#include <direct.h> #include <direct.h>
#include <sys/stat.h>
bool isExistOnFs(const UString & path) { bool isExistOnFs(const UString & path) {
struct _stat buf; struct _stat buf;
return (_stat((const char*)path.toLocal8Bit(), &buf) == 0); return (_stat((const char*)path.toLocal8Bit(), &buf) == 0);
@ -35,6 +34,19 @@ bool changeDirectory(const UString & dir) {
return (_chdir((const char*)dir.toLocal8Bit()) == 0); return (_chdir((const char*)dir.toLocal8Bit()) == 0);
} }
#else #else
#include <unistd.h>
bool isExistOnFs(const UString & path) {
struct stat buf;
return (stat((const char*)path.toLocal8Bit(), &buf) == 0);
}
bool makeDirectory(const UString & dir) {
return (mkdir((const char*)dir.toLocal8Bit(), ACCESSPERMS) == 0);
}
bool changeDirectory(const UString & dir) {
return (chdir((const char*)dir.toLocal8Bit()) == 0);
}
#endif #endif
USTATUS UEFIDumper::dump(const UByteArray & buffer, const UString & inPath, const UString & guid) USTATUS UEFIDumper::dump(const UByteArray & buffer, const UString & inPath, const UString & guid)

View File

@ -36,6 +36,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "types.h" #include "types.h"
#include "treeitem.h" #include "treeitem.h"
class TreeModel;
class UModelIndex class UModelIndex
{ {
friend class TreeModel; friend class TreeModel;