UFO: Alien Invasion
Loading...
Searching...
No Matches
ScopedCommand.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
6private:
7 const std::string _scopeLeaveCommand;
8public:
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
23 {
25 }
26};
ScopedCommand(const std::string &command, const std::string &scopeEnterParameter, const std::string &scopeLeaveParameter)
ScopedCommand(const std::string &scopeEnterCommand, const std::string &scopeLeaveCommand)
const std::string _scopeLeaveCommand
void Cmd_ExecuteString(const char *text,...)
A complete command line has been parsed, so try to execute it.
Definition cmd.cpp:1007