aboutsummaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2024-09-30 10:23:55 -0700
committerMike Buland <mike@xagasoft.com>2024-09-30 10:23:55 -0700
commit84c93fbf0f371bcd26893d1c33e3a5bf1a61223e (patch)
treed27e8405e81c14762c083efc20e3b936b4bd7982 /src/tools
parent76821551f312dd447a03748a01670f3718cd8345 (diff)
downloadlibbu++-84c93fbf0f371bcd26893d1c33e3a5bf1a61223e.tar.gz
libbu++-84c93fbf0f371bcd26893d1c33e3a5bf1a61223e.tar.bz2
libbu++-84c93fbf0f371bcd26893d1c33e3a5bf1a61223e.tar.xz
libbu++-84c93fbf0f371bcd26893d1c33e3a5bf1a61223e.zip
Forgot about erase, it seems to be working now.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/myriad.cpp18
1 files changed, 18 insertions, 0 deletions
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
20 modeCreate, 20 modeCreate,
21 modeInfo, 21 modeInfo,
22 modeStreamNew, 22 modeStreamNew,
23 modeStreamErase,
23 modeStreamDump, 24 modeStreamDump,
24 modeStreamPut, 25 modeStreamPut,
25 modeStreamGet, 26 modeStreamGet,
@@ -44,6 +45,8 @@ public:
44 "Display some info about a Myriad file." ); 45 "Display some info about a Myriad file." );
45 addOption( eMode, 'n', "new", 46 addOption( eMode, 'n', "new",
46 "Create a new sub-stream in a Myriad file."); 47 "Create a new sub-stream in a Myriad file.");
48 addOption( eMode, 'e', "erase",
49 "Erase sub-stream in a Myriad file.");
47 addOption( eMode, 'd', "dump", 50 addOption( eMode, 'd', "dump",
48 "Display a hexdump of a stream from a Myriad file."); 51 "Display a hexdump of a stream from a Myriad file.");
49 addOption( eMode, "get", 52 addOption( eMode, "get",
@@ -67,6 +70,7 @@ public:
67 setOverride( "create", modeCreate ); 70 setOverride( "create", modeCreate );
68 setOverride( "info", modeInfo ); 71 setOverride( "info", modeInfo );
69 setOverride( "new", modeStreamNew ); 72 setOverride( "new", modeStreamNew );
73 setOverride( "erase", modeStreamErase );
70 setOverride( "dump", modeStreamDump ); 74 setOverride( "dump", modeStreamDump );
71 setOverride( "put", modeStreamPut ); 75 setOverride( "put", modeStreamPut );
72 setOverride( "get", modeStreamGet ); 76 setOverride( "get", modeStreamGet );
@@ -153,6 +157,20 @@ int main( int argc, char *argv[] )
153 } 157 }
154 break; 158 break;
155 159
160 case modeStreamErase:
161 if( !opts.sFile.isSet() )
162 {
163 sio << "Please specify a file manipulate." << sio.nl;
164 return 0;
165 }
166 else
167 {
168 File fOut( opts.sFile, File::Write|File::Read );
169 Myriad m( fOut );
170 m.erase( opts.iStream );
171 }
172 break;
173
156 case modeStreamDump: 174 case modeStreamDump:
157 if( !opts.sFile.isSet() ) 175 if( !opts.sFile.isSet() )
158 { 176 {