summaryrefslogtreecommitdiff
path: root/hammer/shell.h
blob: 2873f9da65940ade54a4c43cc089e365167f2c11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Handles parsing and routing of shell commands to their handlers.
//
// $NoKeywords: $
//=============================================================================//

#ifndef SHELL_H
#define SHELL_H
#pragma once


class CMapDoc;
struct ShellDispatchTable_t;


class CShell
{
	public:

		CShell(void);
		~CShell(void);

		void SetDocument(CMapDoc *pDoc);
		bool RunCommand(const char *pszCommand);

	private:

		//
		// Shell command handlers.
		//
		bool BeginSession(const char *pszCommand, const char *pszArguments);
		bool CheckMapVersion(const char *pszCommand, const char *pszArguments);
		bool EndSession(const char *pszCommand, const char *pszArguments);
		bool EntityCreate(const char *pszCommand, const char *pszArguments);
		bool EntityDelete(const char *pszCommand, const char *pszArguments);
		bool EntitySetKeyValue(const char *pszCommand, const char *pszArguments);
		bool EntityRotateIncremental(const char *pszCommand, const char *pszArguments);
		bool NodeCreate(const char *pszCommand, const char *pszArguments);
		bool NodeDelete(const char *pszCommand, const char *pszArguments);
		bool NodeLinkCreate(const char *pszCommand, const char *pszArguments);
		bool NodeLinkDelete(const char *pszCommand, const char *pszArguments);
		bool ReleaseVideoMemory(const char *pszCommand, const char *pszArguments);
		bool GrabVideoMemory(const char *pszCommand, const char *pszArguments);

		//
		// Utility functions.
		//
		bool DoVersionCheck(const char *pszArguments);

		static ShellDispatchTable_t m_DispatchTable[];

		CMapDoc *m_pDoc;
};

#endif // SHELL_H