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