From 80b85cbf195ffa726f5c85ebfcf87fdc98cbc67f Mon Sep 17 00:00:00 2001 From: Nikolaj Schlej Date: Sat, 9 Jul 2016 08:50:34 +0200 Subject: [PATCH] Unix compatibility for UD 0.1.0 - a few naming changes and then the release, yay --- UEFIDump/uefidump.cpp | 16 ++++++++++++++-- common/treemodel.h | 2 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/UEFIDump/uefidump.cpp b/UEFIDump/uefidump.cpp index 3aca67b..a66631d 100644 --- a/UEFIDump/uefidump.cpp +++ b/UEFIDump/uefidump.cpp @@ -17,11 +17,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #ifdef WIN32 #include -#include - bool isExistOnFs(const UString & path) { struct _stat buf; return (_stat((const char*)path.toLocal8Bit(), &buf) == 0); @@ -35,6 +34,19 @@ bool changeDirectory(const UString & dir) { return (_chdir((const char*)dir.toLocal8Bit()) == 0); } #else +#include +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 USTATUS UEFIDumper::dump(const UByteArray & buffer, const UString & inPath, const UString & guid) diff --git a/common/treemodel.h b/common/treemodel.h index f48fa39..84ee141 100644 --- a/common/treemodel.h +++ b/common/treemodel.h @@ -36,6 +36,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "types.h" #include "treeitem.h" +class TreeModel; + class UModelIndex { friend class TreeModel;