aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2024-08-05 10:39:29 -0700
committerMike Buland <mike@xagasoft.com>2024-08-05 10:39:29 -0700
commitd344a682170e42ef3ca4e37b397428f9ba5fdb11 (patch)
tree39ff2374b6cfafccfb64cf87ae5fa8c0321794c0
parentf6f5206b1ac2ba48660db7b6858e32612a6ffd05 (diff)
downloadlibbu++-d344a682170e42ef3ca4e37b397428f9ba5fdb11.tar.gz
libbu++-d344a682170e42ef3ca4e37b397428f9ba5fdb11.tar.bz2
libbu++-d344a682170e42ef3ca4e37b397428f9ba5fdb11.tar.xz
libbu++-d344a682170e42ef3ca4e37b397428f9ba5fdb11.zip
Added getLocation() support to Bu::File.
It returns "file:<requested path>" which could be made better eventually, but it's nice, I like the format, it'll be good for memory buffers to be able to report in a similar way.
-rw-r--r--src/stable/file.cpp3
-rw-r--r--src/stable/file.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/stable/file.cpp b/src/stable/file.cpp
index 3487068..05e4af1 100644
--- a/src/stable/file.cpp
+++ b/src/stable/file.cpp
@@ -34,6 +34,7 @@ Bu::File::File( const Bu::String &sName, int iFlags ) :
34 strerror(errno), sName.getStr() ); 34 strerror(errno), sName.getStr() );
35 } 35 }
36 bEos = false; 36 bEos = false;
37 sLocation = "file:" + sName.clone();
37} 38}
38 39
39Bu::File::File( int fd ) : 40Bu::File::File( int fd ) :
@@ -274,7 +275,7 @@ Bu::size Bu::File::getBlockSize() const
274 275
275Bu::String Bu::File::getLocation() const 276Bu::String Bu::File::getLocation() const
276{ 277{
277 return "to be implemented"; 278 return sLocation.clone();
278} 279}
279 280
280void Bu::File::stat( struct ::stat *pStat ) 281void Bu::File::stat( struct ::stat *pStat )
diff --git a/src/stable/file.h b/src/stable/file.h
index 0f9b7d3..dfdc1a4 100644
--- a/src/stable/file.h
+++ b/src/stable/file.h
@@ -123,6 +123,7 @@ namespace Bu
123 private: 123 private:
124 int fd; 124 int fd;
125 bool bEos; 125 bool bEos;
126 Bu::String sLocation;
126 }; 127 };
127} 128}
128 129