ScriptCommand.h revision 87f34658dec9097d987d254a990ea7f311bfc95f
1//===- ScriptCommand.h ----------------------------------------------------===// 2// 3// The MCLinker Project 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9#ifndef MCLD_SCRIPT_COMMAND_H 10#define MCLD_SCRIPT_COMMAND_H 11#ifdef ENABLE_UNITTEST 12#include <gtest.h> 13#endif 14 15namespace mcld { 16 17class Module; 18 19/** \class ScriptCommand 20 * \brief This class defines the interfaces to a script command. 21 */ 22class ScriptCommand 23{ 24public: 25 enum Kind { 26 ENTRY, 27 OUTPUT_FORMAT, 28 GROUP, 29 OUTPUT, 30 SEARCH_DIR, 31 OUTPUT_ARCH, 32 ASSERT, 33 ASSIGNMENT, 34 SECTIONS, 35 OUTPUT_SECT_DESC, 36 INPUT_SECT_DESC 37 }; 38 39protected: 40 ScriptCommand(Kind pKind) 41 : m_Kind(pKind) 42 {} 43 44public: 45 virtual ~ScriptCommand() = 0; 46 47 virtual void dump() const = 0; 48 49 virtual void activate(Module&) = 0; 50 51 Kind getKind() const { return m_Kind; } 52 53private: 54 Kind m_Kind; 55}; 56 57} // namespace of mcld 58 59#endif 60 61