summaryrefslogtreecommitdiff
path: root/include/mcld/Script/FileToken.h
blob: 4beaacb03bf9df3d5cc0782f037a7c79c9ad21a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//===- FileToken.h --------------------------------------------------------===//
//
//                     The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_SCRIPT_FILETOKEN_H
#define MCLD_SCRIPT_FILETOKEN_H

#include <mcld/Script/InputToken.h>
#include <mcld/Support/Allocators.h>
#include <mcld/Config/Config.h>

namespace mcld
{

/** \class FileToken
 *  \brief This class defines the interfaces to a filename in INPUT/GROUP
 *         command.
 */

class FileToken : public InputToken
{
private:
  friend class Chunk<FileToken, MCLD_SYMBOLS_PER_INPUT>;
  FileToken();
  FileToken(const std::string& pName, bool pAsNeeded);

public:
  ~FileToken();

  static bool classof(const InputToken* pToken)
  {
    return pToken->type() == InputToken::File;
  }

  /* factory method */
  static FileToken* create(const std::string& pName, bool pAsNeeded);
  static void destroy(FileToken*& pToken);
  static void clear();
};

} // namepsace of mcld

#endif