UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
ScopedCommand.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
5
class
ScopedCommand
{
6
private
:
7
const
std::string
_scopeLeaveCommand
;
8
public
:
9
ScopedCommand
(
const
std::string& scopeEnterCommand,
const
std::string& scopeLeaveCommand) :
10
_scopeLeaveCommand
(scopeLeaveCommand)
11
{
12
Cmd_ExecuteString
(
"%s"
, scopeEnterCommand.c_str());
13
}
14
15
ScopedCommand
(
const
std::string& command,
const
std::string& scopeEnterParameter,
const
std::string& scopeLeaveParameter) :
16
_scopeLeaveCommand
(command +
" "
+ scopeLeaveParameter)
17
{
18
const
std::string enter = command +
" "
+ scopeEnterParameter;
19
Cmd_ExecuteString
(
"%s"
, enter.c_str());
20
}
21
22
~ScopedCommand
()
23
{
24
Cmd_ExecuteString
(
"%s"
,
_scopeLeaveCommand
.c_str());
25
}
26
};
ScopedCommand::~ScopedCommand
~ScopedCommand()
Definition
ScopedCommand.h:22
ScopedCommand::ScopedCommand
ScopedCommand(const std::string &command, const std::string &scopeEnterParameter, const std::string &scopeLeaveParameter)
Definition
ScopedCommand.h:15
ScopedCommand::ScopedCommand
ScopedCommand(const std::string &scopeEnterCommand, const std::string &scopeLeaveCommand)
Definition
ScopedCommand.h:9
ScopedCommand::_scopeLeaveCommand
const std::string _scopeLeaveCommand
Definition
ScopedCommand.h:7
Cmd_ExecuteString
void Cmd_ExecuteString(const char *text,...)
A complete command line has been parsed, so try to execute it.
Definition
cmd.cpp:1007
src
common
ScopedCommand.h
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0