FreeRTOS console and io devices support for compile
git-svn-id: svn://db.shs.com.ru/pip@688 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -19,7 +19,12 @@
|
||||
#include "piincludes_p.h"
|
||||
#include "pidir.h"
|
||||
|
||||
//#if !defined(ANDROID)
|
||||
#ifdef ESP_PLATFORM
|
||||
extern "C" {
|
||||
# include "esp_spiffs.h"
|
||||
}
|
||||
#endif
|
||||
|
||||
const PIChar PIDir::separator = '/';
|
||||
#ifdef QNX
|
||||
# define _stat_struct_ struct stat
|
||||
@@ -34,14 +39,18 @@ const PIChar PIDir::separator = '/';
|
||||
# ifdef ANDROID
|
||||
# include <dirent.h>
|
||||
# else
|
||||
# include <sys/dir.h>
|
||||
# ifdef FREERTOS
|
||||
# include <sys/dirent.h>
|
||||
# else
|
||||
# include <sys/dir.h>
|
||||
# endif
|
||||
# endif
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
/*! \class PIDir
|
||||
* \brief Local directory
|
||||
*
|
||||
*
|
||||
* \section PIDir_sec0 Synopsis
|
||||
* This class provide access to local file. You can manipulate
|
||||
* binary content or use this class as text stream. To binary
|
||||
@@ -284,7 +293,7 @@ PIVector<PIFile::FileInfo> PIDir::entries() {
|
||||
}
|
||||
|
||||
#else
|
||||
# ifdef QNX
|
||||
# if defined(QNX) || defined(FREERTOS)
|
||||
struct dirent * de = 0;
|
||||
DIR * dir = 0;
|
||||
dir = opendir(p.data());
|
||||
@@ -299,7 +308,7 @@ PIVector<PIFile::FileInfo> PIDir::entries() {
|
||||
# else
|
||||
dirent ** list;
|
||||
int cnt = scandir(p.data(), &list, 0,
|
||||
# if defined(MAC_OS) || defined(ANDROID) || defined(BLACKBERRY) || defined(QNX)
|
||||
# if defined(MAC_OS) || defined(ANDROID) || defined(BLACKBERRY)
|
||||
alphasort);
|
||||
# else
|
||||
versionsort);
|
||||
@@ -349,9 +358,11 @@ bool PIDir::isExists(const PIString & path) {
|
||||
DWORD ret = GetFileAttributes((LPCTSTR)(path.data()));
|
||||
return (ret != 0xFFFFFFFF) && (ret & FILE_ATTRIBUTE_DIRECTORY);
|
||||
#else
|
||||
#ifndef ESP_PLATFORM
|
||||
DIR * dir_ = opendir(path.data());
|
||||
if (dir_ == 0) return false;
|
||||
closedir(dir_);
|
||||
#endif
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
@@ -367,7 +378,9 @@ PIDir PIDir::current() {
|
||||
ret.prepend(separator);
|
||||
return PIDir(ret);
|
||||
#else
|
||||
#ifndef ESP_PLATFORM
|
||||
if (getcwd(rc, 1024) == 0) return PIString();
|
||||
#endif
|
||||
#endif
|
||||
return PIDir(rc);
|
||||
}
|
||||
@@ -471,4 +484,3 @@ bool PIDir::renameDir(const PIString & path, const PIString & new_name) {
|
||||
}
|
||||
|
||||
|
||||
//#endif
|
||||
|
||||
Reference in New Issue
Block a user