diff options
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/myriad.cpp | 18 |
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 | { |