From 84c93fbf0f371bcd26893d1c33e3a5bf1a61223e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 30 Sep 2024 10:23:55 -0700 Subject: Forgot about erase, it seems to be working now. --- src/tools/myriad.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/tools') diff --git a/src/tools/myriad.cpp b/src/tools/myriad.cpp index 1dc73ec..346cd85 100644 --- a/src/tools/myriad.cpp +++ b/src/tools/myriad.cpp @@ -20,6 +20,7 @@ enum Mode modeCreate, modeInfo, modeStreamNew, + modeStreamErase, modeStreamDump, modeStreamPut, modeStreamGet, @@ -44,6 +45,8 @@ public: "Display some info about a Myriad file." ); addOption( eMode, 'n', "new", "Create a new sub-stream in a Myriad file."); + addOption( eMode, 'e', "erase", + "Erase sub-stream in a Myriad file."); addOption( eMode, 'd', "dump", "Display a hexdump of a stream from a Myriad file."); addOption( eMode, "get", @@ -67,6 +70,7 @@ public: setOverride( "create", modeCreate ); setOverride( "info", modeInfo ); setOverride( "new", modeStreamNew ); + setOverride( "erase", modeStreamErase ); setOverride( "dump", modeStreamDump ); setOverride( "put", modeStreamPut ); setOverride( "get", modeStreamGet ); @@ -153,6 +157,20 @@ int main( int argc, char *argv[] ) } break; + case modeStreamErase: + if( !opts.sFile.isSet() ) + { + sio << "Please specify a file manipulate." << sio.nl; + return 0; + } + else + { + File fOut( opts.sFile, File::Write|File::Read ); + Myriad m( fOut ); + m.erase( opts.iStream ); + } + break; + case modeStreamDump: if( !opts.sFile.isSet() ) { -- cgit v1.2.3