openMSX
Main Page
Namespaces
Classes
Files
File List
File Members
ide
CDImageCLI.cc
Go to the documentation of this file.
1
#include "
CDImageCLI.hh
"
2
#include "
CommandLineParser.hh
"
3
#include "
GlobalCommandController.hh
"
4
#include "
TclObject.hh
"
5
#include "
MSXException.hh
"
6
7
using
std::deque;
8
using
std::string;
9
10
namespace
openmsx {
11
12
CDImageCLI::CDImageCLI
(
CommandLineParser
& parser_)
13
: parser(parser_)
14
{
15
parser.
registerOption
(
"-cda"
, *
this
);
16
// TODO: offer more options in case you want to specify 2 hard disk images?
17
}
18
19
void
CDImageCLI::parseOption
(
const
string
& option, deque<string>& cmdLine)
20
{
21
string_ref
cd =
string_ref
(option).
substr
(1);
// cda
22
string
filename =
getArgument
(option, cmdLine);
23
if
(!parser.
getGlobalCommandController
().
hasCommand
(cd)) {
// TODO WIP
24
throw
MSXException
(
"No CDROM named '"
+ cd +
"'."
);
25
}
26
TclObject
command(parser.
getGlobalCommandController
().
getInterpreter
());
27
command.
addListElement
(cd);
28
command.addListElement(filename);
29
command.executeCommand();
30
}
31
string_ref
CDImageCLI::optionHelp
()
const
32
{
33
return
"Use iso image in argument for the CDROM extension"
;
34
}
35
36
}
// namespace openmsx
Generated on Sat May 18 2013 15:17:35 for openMSX by
1.8.1.2