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