File/Directory Enhancement

- Migrated enhanced code out of taskd.
This commit is contained in:
Paul Beckingham
2011-04-16 00:44:07 -04:00
parent e9273cd6c3
commit 87c285e6b2
5 changed files with 234 additions and 20 deletions

View File

@@ -24,9 +24,11 @@
// USA
//
////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDED_FILE
#define INCLUDED_FILE
#include <stdio.h>
#include <string>
#include <vector>
#include <sys/stat.h>
@@ -46,19 +48,21 @@ public:
virtual bool create ();
virtual bool remove ();
// bool open ();
// bool openAndLock ();
// void close ();
bool open ();
bool openAndLock ();
void close ();
// bool lock ();
// bool lockNoWait ();
// void unlock ();
bool lock ();
bool waitForLock ();
// void read (std::string&);
// void read (std::vector <std::string>&);
void read (std::string&);
void read (std::vector <std::string>&);
// void write (const std::string&);
// void write (const std::vector <std::string>&);
void write (const std::string&);
void write (const std::vector <std::string>&);
void append (const std::string&);
void append (const std::vector <std::string>&);
virtual mode_t mode ();
virtual size_t size () const;
@@ -75,7 +79,8 @@ public:
static bool remove (const std::string&);
private:
// int handle;
FILE* fh;
int h;
};
#endif