From 68efb78a8840b81e7237f62d81831f3fdbed749b Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 7 Aug 2012 17:16:19 +0000 Subject: Adding filesystem access classes, and converting Bu::Server to using ppoll. I have to test to see if it works with mingw though. --- src/experimental/dir.cpp | 14 ++++++++++++++ src/experimental/dir.h | 20 ++++++++++++++++++++ src/experimental/filesystem.cpp | 10 ++++++++++ src/experimental/filesystem.h | 24 ++++++++++++++++++++++++ src/stable/server.cpp | 3 +++ 5 files changed, 71 insertions(+) create mode 100644 src/experimental/dir.cpp create mode 100644 src/experimental/dir.h create mode 100644 src/experimental/filesystem.cpp create mode 100644 src/experimental/filesystem.h (limited to 'src') diff --git a/src/experimental/dir.cpp b/src/experimental/dir.cpp new file mode 100644 index 0000000..fb7040c --- /dev/null +++ b/src/experimental/dir.cpp @@ -0,0 +1,14 @@ +#include "bu/dir.h" + +Bu::Dir::Dir() +{ +} + +Bu::Dir::Dir( const Bu::String &sPath ) +{ +} + +Bu::Dir::~Dir() +{ +} + diff --git a/src/experimental/dir.h b/src/experimental/dir.h new file mode 100644 index 0000000..8e885d1 --- /dev/null +++ b/src/experimental/dir.h @@ -0,0 +1,20 @@ +#ifndef BU_DIR_H +#define BU_DIR_H + +#include "bu/filesystem.h" +#include "bu/string.h" + +namespace Bu +{ + class Dir : public FileSystem + { + public: + Dir(); + Dir( const Bu::String &sPath ); + virtual ~Dir(); + + private: + }; +}; + +#endif diff --git a/src/experimental/filesystem.cpp b/src/experimental/filesystem.cpp new file mode 100644 index 0000000..fcc555f --- /dev/null +++ b/src/experimental/filesystem.cpp @@ -0,0 +1,10 @@ +#include "bu/filesystem.h" + +Bu::FileSystem::FileSystem() +{ +} + +Bu::FileSystem::~FileSystem() +{ +} + diff --git a/src/experimental/filesystem.h b/src/experimental/filesystem.h new file mode 100644 index 0000000..0c992a5 --- /dev/null +++ b/src/experimental/filesystem.h @@ -0,0 +1,24 @@ +#ifndef BU_FILE_SYSTEM_H +#define BU_FILE_SYSTEM_H + +namespace Bu +{ + /** + * Represents an abstract baseclass for any file organization structure. + * If you're looking for acessing a local filesystem, try Bu::Dir. This + * is used to make switching between different types of filesystems + * seamless. FileSystems could be anything that organizes and grants + * access to file data, local filesystems, FTP servers, zip or myriadfs + * files, etc. + */ + class FileSystem + { + public: + FileSystem(); + virtual ~FileSystem(); + + + }; +}; + +#endif diff --git a/src/stable/server.cpp b/src/stable/server.cpp index e4769a5..7d82439 100644 --- a/src/stable/server.cpp +++ b/src/stable/server.cpp @@ -8,6 +8,7 @@ #include "bu/server.h" #include #include +#include #include "bu/tcpserversocket.h" #include "bu/client.h" #include "bu/tcpsocket.h" @@ -46,6 +47,8 @@ void Bu::Server::setTimeout( int nTimeoutSec, int nTimeoutUSec ) { this->nTimeoutSec = nTimeoutSec; this->nTimeoutUSec = nTimeoutUSec; +// struct timespec xTimeout = { nTimeoutSec, nTimeoutUSec }; +// ppoll( NULL, 0, &xTimeout, NULL ); } void Bu::Server::scan() -- cgit v1.2.3