openMSX
Main Page
Namespaces
Classes
Files
File List
File Members
cassette
CassettePlayerCLI.cc
Go to the documentation of this file.
1
#include "
CassettePlayerCLI.hh
"
2
#include "
CommandLineParser.hh
"
3
#include "
GlobalCommandController.hh
"
4
#include "
MSXException.hh
"
5
#include "
TclObject.hh
"
6
7
using
std::deque;
8
using
std::string;
9
10
namespace
openmsx {
11
12
CassettePlayerCLI::CassettePlayerCLI
(
CommandLineParser
& parser_)
13
: parser(parser_)
14
{
15
parser.
registerOption
(
"-cassetteplayer"
, *
this
);
16
parser.
registerFileClass
(
"cassetteimage"
, *
this
);
17
}
18
19
void
CassettePlayerCLI::parseOption
(
const
string
& option, deque<string>& cmdLine)
20
{
21
parseFileType
(
getArgument
(option, cmdLine), cmdLine);
22
}
23
24
string_ref
CassettePlayerCLI::optionHelp
()
const
25
{
26
return
"Put cassette image specified in argument in "
27
"virtual cassetteplayer"
;
28
}
29
30
void
CassettePlayerCLI::parseFileType
(
const
string
& filename,
31
deque<string>&
/*cmdLine*/
)
32
{
33
if
(!parser.
getGlobalCommandController
().
hasCommand
(
"cassetteplayer"
)) {
34
throw
MSXException
(
"No cassetteplayer."
);
35
}
36
TclObject
command(parser.
getGlobalCommandController
().
getInterpreter
());
37
command.
addListElement
(
"cassetteplayer"
);
38
command.addListElement(filename);
39
command.executeCommand();
40
}
41
42
string_ref
CassettePlayerCLI::fileTypeHelp
()
const
43
{
44
return
"Cassette image, raw recording or fMSX CAS image"
;
45
}
46
47
}
// namespace openmsx
Generated on Sat May 18 2013 21:18:23 for openMSX by
1.8.1.2