187f34658dec9097d987d254a990ea7f311bfc95fStephen Hines//===- OutputFormatCmd.h --------------------------------------------------===//
287f34658dec9097d987d254a990ea7f311bfc95fStephen Hines//
387f34658dec9097d987d254a990ea7f311bfc95fStephen Hines//                     The MCLinker Project
487f34658dec9097d987d254a990ea7f311bfc95fStephen Hines//
587f34658dec9097d987d254a990ea7f311bfc95fStephen Hines// This file is distributed under the University of Illinois Open Source
687f34658dec9097d987d254a990ea7f311bfc95fStephen Hines// License. See LICENSE.TXT for details.
787f34658dec9097d987d254a990ea7f311bfc95fStephen Hines//
887f34658dec9097d987d254a990ea7f311bfc95fStephen Hines//===----------------------------------------------------------------------===//
937b74a387bb3993387029859c2d9d051c41c724eStephen Hines#ifndef MCLD_SCRIPT_OUTPUTFORMATCMD_H_
1037b74a387bb3993387029859c2d9d051c41c724eStephen Hines#define MCLD_SCRIPT_OUTPUTFORMATCMD_H_
1137b74a387bb3993387029859c2d9d051c41c724eStephen Hines
1237b74a387bb3993387029859c2d9d051c41c724eStephen Hines#include "mcld/Script/ScriptCommand.h"
1387f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
1487f34658dec9097d987d254a990ea7f311bfc95fStephen Hines#include <string>
1587f34658dec9097d987d254a990ea7f311bfc95fStephen Hines#include <vector>
1687f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
1737b74a387bb3993387029859c2d9d051c41c724eStephen Hinesnamespace mcld {
1887f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
1987f34658dec9097d987d254a990ea7f311bfc95fStephen Hinesclass Module;
2087f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
2187f34658dec9097d987d254a990ea7f311bfc95fStephen Hines/** \class OutputFormatCmd
2287f34658dec9097d987d254a990ea7f311bfc95fStephen Hines *  \brief This class defines the interfaces to OutputFormat command.
2387f34658dec9097d987d254a990ea7f311bfc95fStephen Hines */
2487f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
2537b74a387bb3993387029859c2d9d051c41c724eStephen Hinesclass OutputFormatCmd : public ScriptCommand {
2637b74a387bb3993387029859c2d9d051c41c724eStephen Hines public:
2787f34658dec9097d987d254a990ea7f311bfc95fStephen Hines  typedef std::vector<std::string> FormatList;
2887f34658dec9097d987d254a990ea7f311bfc95fStephen Hines  typedef FormatList::const_iterator const_iterator;
2987f34658dec9097d987d254a990ea7f311bfc95fStephen Hines  typedef FormatList::iterator iterator;
3087f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
3137b74a387bb3993387029859c2d9d051c41c724eStephen Hines public:
3237b74a387bb3993387029859c2d9d051c41c724eStephen Hines  explicit OutputFormatCmd(const std::string& pFormat);
3387f34658dec9097d987d254a990ea7f311bfc95fStephen Hines  OutputFormatCmd(const std::string& pDefault,
3487f34658dec9097d987d254a990ea7f311bfc95fStephen Hines                  const std::string& pBig,
3587f34658dec9097d987d254a990ea7f311bfc95fStephen Hines                  const std::string& pLittle);
3687f34658dec9097d987d254a990ea7f311bfc95fStephen Hines  ~OutputFormatCmd();
3787f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
3887f34658dec9097d987d254a990ea7f311bfc95fStephen Hines  const_iterator begin() const { return m_FormatList.begin(); }
3937b74a387bb3993387029859c2d9d051c41c724eStephen Hines  iterator begin() { return m_FormatList.begin(); }
4037b74a387bb3993387029859c2d9d051c41c724eStephen Hines  const_iterator end() const { return m_FormatList.end(); }
4137b74a387bb3993387029859c2d9d051c41c724eStephen Hines  iterator end() { return m_FormatList.end(); }
4287f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
4387f34658dec9097d987d254a990ea7f311bfc95fStephen Hines  void dump() const;
4487f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
4537b74a387bb3993387029859c2d9d051c41c724eStephen Hines  static bool classof(const ScriptCommand* pCmd) {
4687f34658dec9097d987d254a990ea7f311bfc95fStephen Hines    return pCmd->getKind() == ScriptCommand::OUTPUT_FORMAT;
4787f34658dec9097d987d254a990ea7f311bfc95fStephen Hines  }
4887f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
4987f34658dec9097d987d254a990ea7f311bfc95fStephen Hines  void activate(Module& pModule);
5087f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
5137b74a387bb3993387029859c2d9d051c41c724eStephen Hines private:
5287f34658dec9097d987d254a990ea7f311bfc95fStephen Hines  FormatList m_FormatList;
5387f34658dec9097d987d254a990ea7f311bfc95fStephen Hines};
5487f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
5537b74a387bb3993387029859c2d9d051c41c724eStephen Hines}  // namespace mcld
5687f34658dec9097d987d254a990ea7f311bfc95fStephen Hines
5737b74a387bb3993387029859c2d9d051c41c724eStephen Hines#endif  // MCLD_SCRIPT_OUTPUTFORMATCMD_H_
58