summaryrefslogtreecommitdiff
path: root/src/file.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-06-10 21:28:14 +0000
committerMike Buland <eichlan@xagasoft.com>2007-06-10 21:28:14 +0000
commit5f39066a4f561e9a94a6cc9293ab9b978ebf1f81 (patch)
treea25698caf9594feecae8b71f032a11f81ba6cc3c /src/file.h
parentf5352edf3dc23c044a91f1d1537fa0dc0f0babc7 (diff)
downloadlibbu++-5f39066a4f561e9a94a6cc9293ab9b978ebf1f81.tar.gz
libbu++-5f39066a4f561e9a94a6cc9293ab9b978ebf1f81.tar.bz2
libbu++-5f39066a4f561e9a94a6cc9293ab9b978ebf1f81.tar.xz
libbu++-5f39066a4f561e9a94a6cc9293ab9b978ebf1f81.zip
Bunch of maintenence type things. Minor tweaks and the like. The file class
has a lot more helper functions and the like, the filters give more info back to the caller, minor updates to taf.
Diffstat (limited to 'src/file.h')
-rw-r--r--src/file.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/file.h b/src/file.h
index ee3fdb3..8107a1b 100644
--- a/src/file.h
+++ b/src/file.h
@@ -3,7 +3,8 @@
3 3
4#include <stdint.h> 4#include <stdint.h>
5 5
6#include "stream.h" 6#include "bu/stream.h"
7#include "bu/fstring.h"
7 8
8namespace Bu 9namespace Bu
9{ 10{
@@ -11,6 +12,8 @@ namespace Bu
11 { 12 {
12 public: 13 public:
13 File( const char *sName, const char *sFlags ); 14 File( const char *sName, const char *sFlags );
15 File( const Bu::FString &sName, const char *sFlags );
16 File( int fd, const char *sFlags );
14 virtual ~File(); 17 virtual ~File();
15 18
16 virtual void close(); 19 virtual void close();
@@ -23,6 +26,8 @@ namespace Bu
23 virtual void setPosEnd( long pos ); 26 virtual void setPosEnd( long pos );
24 virtual bool isEOS(); 27 virtual bool isEOS();
25 28
29 virtual void flush();
30
26 virtual bool canRead(); 31 virtual bool canRead();
27 virtual bool canWrite(); 32 virtual bool canWrite();
28 virtual bool canSeek(); 33 virtual bool canSeek();
@@ -30,6 +35,16 @@ namespace Bu
30 virtual bool isBlocking(); 35 virtual bool isBlocking();
31 virtual void setBlocking( bool bBlocking=true ); 36 virtual void setBlocking( bool bBlocking=true );
32 37
38 inline static Bu::File tempFile( Bu::FString &sName, const char *sFlags )
39 {
40 int afh_d = mkstemp( sName.getStr() );
41
42 return Bu::File( afh_d, sFlags );
43 }
44
45 void truncate( long nSize );
46 void chmod( mode_t t );
47
33 private: 48 private:
34 FILE *fh; 49 FILE *fh;
35 50