aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-08-07 17:16:19 +0000
committerMike Buland <eichlan@xagasoft.com>2012-08-07 17:16:19 +0000
commit68efb78a8840b81e7237f62d81831f3fdbed749b (patch)
tree8de2256e0fa6cedc8700921ce819ada1dde28198
parent7d3b21eb3338a6e7425d0f88916694692ebc28c2 (diff)
downloadlibbu++-68efb78a8840b81e7237f62d81831f3fdbed749b.tar.gz
libbu++-68efb78a8840b81e7237f62d81831f3fdbed749b.tar.bz2
libbu++-68efb78a8840b81e7237f62d81831f3fdbed749b.tar.xz
libbu++-68efb78a8840b81e7237f62d81831f3fdbed749b.zip
Adding filesystem access classes, and converting Bu::Server to using ppoll.
I have to test to see if it works with mingw though.
-rw-r--r--src/experimental/dir.cpp14
-rw-r--r--src/experimental/dir.h20
-rw-r--r--src/experimental/filesystem.cpp10
-rw-r--r--src/experimental/filesystem.h24
-rw-r--r--src/stable/server.cpp3
5 files changed, 71 insertions, 0 deletions
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 @@
1#include "bu/dir.h"
2
3Bu::Dir::Dir()
4{
5}
6
7Bu::Dir::Dir( const Bu::String &sPath )
8{
9}
10
11Bu::Dir::~Dir()
12{
13}
14
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 @@
1#ifndef BU_DIR_H
2#define BU_DIR_H
3
4#include "bu/filesystem.h"
5#include "bu/string.h"
6
7namespace Bu
8{
9 class Dir : public FileSystem
10 {
11 public:
12 Dir();
13 Dir( const Bu::String &sPath );
14 virtual ~Dir();
15
16 private:
17 };
18};
19
20#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 @@
1#include "bu/filesystem.h"
2
3Bu::FileSystem::FileSystem()
4{
5}
6
7Bu::FileSystem::~FileSystem()
8{
9}
10
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 @@
1#ifndef BU_FILE_SYSTEM_H
2#define BU_FILE_SYSTEM_H
3
4namespace Bu
5{
6 /**
7 * Represents an abstract baseclass for any file organization structure.
8 * If you're looking for acessing a local filesystem, try Bu::Dir. This
9 * is used to make switching between different types of filesystems
10 * seamless. FileSystems could be anything that organizes and grants
11 * access to file data, local filesystems, FTP servers, zip or myriadfs
12 * files, etc.
13 */
14 class FileSystem
15 {
16 public:
17 FileSystem();
18 virtual ~FileSystem();
19
20
21 };
22};
23
24#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 @@
8#include "bu/server.h" 8#include "bu/server.h"
9#include <errno.h> 9#include <errno.h>
10#include <unistd.h> 10#include <unistd.h>
11#include <poll.h>
11#include "bu/tcpserversocket.h" 12#include "bu/tcpserversocket.h"
12#include "bu/client.h" 13#include "bu/client.h"
13#include "bu/tcpsocket.h" 14#include "bu/tcpsocket.h"
@@ -46,6 +47,8 @@ void Bu::Server::setTimeout( int nTimeoutSec, int nTimeoutUSec )
46{ 47{
47 this->nTimeoutSec = nTimeoutSec; 48 this->nTimeoutSec = nTimeoutSec;
48 this->nTimeoutUSec = nTimeoutUSec; 49 this->nTimeoutUSec = nTimeoutUSec;
50// struct timespec xTimeout = { nTimeoutSec, nTimeoutUSec };
51// ppoll( NULL, 0, &xTimeout, NULL );
49} 52}
50 53
51void Bu::Server::scan() 54void Bu::Server::scan()