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 17 namespace mcld { 18 19 class ContextFactory; 20 class MemoryAreaFactory; 21 22 /** \class ContextAction 23 * \brief ContextAction is a command object to create input's LDContext. 24 */ 25 class ContextAction : public InputAction 26 { 27 public: 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 */ 36 class MemoryAreaAction : public InputAction 37 { 38 public: 39 MemoryAreaAction(unsigned int pPosition, 40 FileHandle::OpenMode pMode, 41 FileHandle::Permission pPerm = FileHandle::System); 42 43 bool activate(InputBuilder& pBuilder) const; 44 45 private: 46 FileHandle::OpenMode m_Mode; 47 FileHandle::Permission m_Permission; 48 }; 49 50 } // end of namespace mcld 51 52 #endif 53 54