summaryrefslogtreecommitdiff
path: root/lib/codegen/include/code_gen/CG_stringRepr.h
blob: a6df85d60a8acc9c9f9a6725c5a86e7ca8a4e092 (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
/*****************************************************************************
 Copyright (C) 1994-2000 the Omega Project Team
 Copyright (C) 2005-2011 Chun Chen
 All Rights Reserved.

 Purpose:
   pseudo string code wrapper

 Notes:

 History:
   04/17/96 - Lei Zhou - created
*****************************************************************************/

#ifndef _CG_STRINGREPR_H
#define _CG_STRINGREPR_H

#include <code_gen/CG_outputRepr.h>
#include <string>
#include <iostream>

namespace omega {

class CG_stringRepr: public CG_outputRepr {
private:
  std::string s_;

public:
  CG_stringRepr() {}
  CG_stringRepr(const std::string &s) { s_ = s; }
  ~CG_stringRepr() {}
  CG_outputRepr *clone() const { return new CG_stringRepr(s_); }
  void dump() const { std::cout << s_ << std::endl; }

  //---------------------------------------------------------------------------
  // basic operation
  //---------------------------------------------------------------------------
  std::string GetString() const { return s_; }
};

}

#endif