aboutsummaryrefslogtreecommitdiff
path: root/src/file.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
committerMike Buland <eichlan@xagasoft.com>2011-01-20 18:09:04 +0000
commit393f1b414746a7f1977971dd7659dd2b47092b11 (patch)
tree81d0ca1ee70ab86a7d79c1991abe5c387b655fb2 /src/file.h
parentc259f95bd0e58b247940a339bb9b4b401b4e9438 (diff)
parent7e25a863325dc3e9762397e700030969e093b087 (diff)
downloadlibbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.gz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.bz2
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.tar.xz
libbu++-393f1b414746a7f1977971dd7659dd2b47092b11.zip
Wow! Merged the branch, streams are updated, and there's no more FString, run
the fixstrings.sh script in the support directory to (hopefully) automatically update your projects.
Diffstat (limited to '')
-rw-r--r--src/file.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/file.h b/src/file.h
index b2cd2a4..e3225fa 100644
--- a/src/file.h
+++ b/src/file.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2010 Xagasoft, All rights reserved. 2 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
3 * 3 *
4 * This file is part of the libbu++ library and is released under the 4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE. 5 * terms of the license contained in the file LICENSE.
@@ -12,7 +12,7 @@
12#include <sys/types.h> 12#include <sys/types.h>
13 13
14#include "bu/stream.h" 14#include "bu/stream.h"
15#include "bu/fstring.h" 15#include "bu/string.h"
16#include "bu/exceptionbase.h" 16#include "bu/exceptionbase.h"
17 17
18namespace Bu 18namespace Bu
@@ -26,19 +26,19 @@ namespace Bu
26 class File : public Bu::Stream 26 class File : public Bu::Stream
27 { 27 {
28 public: 28 public:
29 File( const Bu::FString &sName, int iFlags ); 29 File( const Bu::String &sName, int iFlags );
30 File( int fd ); 30 File( int fd );
31 virtual ~File(); 31 virtual ~File();
32 32
33 virtual void close(); 33 virtual void close();
34 virtual size_t read( void *pBuf, size_t nBytes ); 34 virtual Bu::size read( void *pBuf, Bu::size nBytes );
35 virtual size_t write( const void *pBuf, size_t nBytes ); 35 virtual Bu::size write( const void *pBuf, Bu::size nBytes );
36 using Stream::write; 36 using Stream::write;
37 37
38 virtual long tell(); 38 virtual Bu::size tell();
39 virtual void seek( long offset ); 39 virtual void seek( Bu::size offset );
40 virtual void setPos( long pos ); 40 virtual void setPos( Bu::size pos );
41 virtual void setPosEnd( long pos ); 41 virtual void setPosEnd( Bu::size pos );
42 virtual bool isEos(); 42 virtual bool isEos();
43 virtual bool isOpen(); 43 virtual bool isOpen();
44 44
@@ -70,17 +70,21 @@ namespace Bu
70 /// Same as Write|Create|Truncate 70 /// Same as Write|Create|Truncate
71 }; 71 };
72 72
73 virtual void setSize( long iSize ); 73 virtual void setSize( Bu::size iSize );
74
75 virtual size getSize() const;
76 virtual size getBlockSize() const;
77 virtual Bu::String getLocation() const;
74 78
75 /** 79 /**
76 * Create a temp file and return its handle. The file is opened 80 * Create a temp file and return its handle. The file is opened
77 * Read/Write. 81 * Read/Write.
78 *@param sName (Bu::FString) Give in the form: "/tmp/tmpfileXXXXXXXX" 82 *@param sName (Bu::String) Give in the form: "/tmp/tmpfileXXXXXXXX"
79 * It will alter your (sName) setting the 'X's to random 83 * It will alter your (sName) setting the 'X's to random
80 * characters. 84 * characters.
81 *@returns (Bu::File) A file object representing your temp file. 85 *@returns (Bu::File) A file object representing your temp file.
82 */ 86 */
83 static Bu::File tempFile( Bu::FString &sName ); 87 static Bu::File tempFile( Bu::String &sName );
84 88
85#ifndef WIN32 89#ifndef WIN32
86 /** 90 /**