/[ascend]/trunk/pygtk/interface/name.cpp
ViewVC logotype

Contents of /trunk/pygtk/interface/name.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 253 - (show annotations) (download) (as text)
Thu Feb 2 00:24:38 2006 UTC (14 years, 6 months ago) by johnpye
File MIME type: text/x-c++src
File size: 874 byte(s)
Adding reorderable and movable columns in Observer.
Removing some debug output from console
1 #include <iostream>
2 #include <stdexcept>
3 #include <sstream>
4 using namespace std;
5
6 #include "name.h"
7
8 extern "C"{
9 #include <general/dstring.h>
10 #include <utilities/ascConfig.h>
11 #include <compiler/compiler.h>
12 #include <compiler/types.h>
13 #include <compiler/symtab.h>
14 #include <compiler/nameio.h>
15 }
16
17 Nam::Nam(){
18 throw runtime_error("Can't create new Nam objects");
19 }
20
21 Nam::Nam(struct Name *name) : name(name){
22 // nothing else
23 }
24
25 Nam::Nam(const SymChar &sym){
26 //cerr << "CREATING NAME from SymChar '" << sym << "'" << endl;
27 name = CreateIdName(sym.getInternalType());
28 }
29
30 Nam::~Nam(){
31 // cerr << "DESTROY NAME" << endl;
32 DestroyName(name);
33 }
34
35 const string
36 Nam::getName() const{
37 /// @TODO Make this more efficient...
38 stringstream ss;
39 char *longname = WriteNameString(name);
40 ss << longname;
41 return ss.str();
42 }
43
44 struct Name *
45 Nam::getInternalType() const{
46 return name;
47 }
48

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22