FileAction.h revision 22add6ff3426df1a85089fe6a6e1597ee3b6f300
1//===- FileAction.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_MC_FILE_ACTION_H 10#define MCLD_MC_FILE_ACTION_H 11#ifdef ENABLE_UNITTEST 12#include <gtest.h> 13#endif 14#include <mcld/MC/InputAction.h> 15#include <mcld/Support/FileHandle.h> 16 17namespace mcld { 18 19class ContextFactory; 20class MemoryAreaFactory; 21 22/** \class ContextAction 23 * \brief ContextAction is a command object to create input's LDContext. 24 */ 25class ContextAction : public InputAction 26{ 27public: 28 explicit ContextAction(unsigned int pPosition); 29 30 bool activate(InputBuilder& pBuilder) const; 31}; 32 33/** \class MemoryAreaAction 34 * \brief MemoryAreaAction is a command object to create input's MemoryArea. 35 */ 36class MemoryAreaAction : public InputAction 37{ 38public: 39 MemoryAreaAction(unsigned int pPosition, 40 FileHandle::OpenMode pMode, 41 FileHandle::Permission pPerm = FileHandle::System); 42 43 bool activate(InputBuilder& pBuilder) const; 44 45private: 46 FileHandle::OpenMode m_Mode; 47 FileHandle::Permission m_Permission; 48}; 49 50} // end of namespace mcld 51 52#endif 53 54