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 { 23 public: 24 explicit ContextAction(unsigned int pPosition); 25 26 bool activate(InputBuilder& pBuilder) const; 27 }; 28 29 /** \class MemoryAreaAction 30 * \brief MemoryAreaAction is a command object to create input's MemoryArea. 31 */ 32 class MemoryAreaAction : public InputAction 33 { 34 public: 35 MemoryAreaAction(unsigned int pPosition, 36 FileHandle::OpenMode pMode, 37 FileHandle::Permission pPerm = FileHandle::System); 38 39 bool activate(InputBuilder& pBuilder) const; 40 41 private: 42 FileHandle::OpenMode m_Mode; 43 FileHandle::Permission m_Permission; 44 }; 45 46 } // end of namespace mcld 47 48 #endif 49 50