From d344a682170e42ef3ca4e37b397428f9ba5fdb11 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Aug 2024 10:39:29 -0700 Subject: Added getLocation() support to Bu::File. It returns "file:" 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. --- src/stable/file.cpp | 3 ++- src/stable/file.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/stable') 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 ) : strerror(errno), sName.getStr() ); } bEos = false; + sLocation = "file:" + sName.clone(); } Bu::File::File( int fd ) : @@ -274,7 +275,7 @@ Bu::size Bu::File::getBlockSize() const Bu::String Bu::File::getLocation() const { - return "to be implemented"; + return sLocation.clone(); } void 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 private: int fd; bool bEos; + Bu::String sLocation; }; } -- cgit v1.2.3