Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!CSSUN.TAMU.EDU!jeffw From: jeffw@CSSUN.TAMU.EDU (Jeffrey A Waller) Newsgroups: gnu.g++.bug Subject: Stringnode.c Message-ID: <8910092234.AA14182@cssune.tamu.edu> Date: 9 Oct 89 22:34:42 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 36 #include "Stringnode.h" node *Stringnode::Copy() { return(new Stringnode(*this)); } unsigned long Stringnode::IdentifySelf() { return(Stringnode_id); } int Stringnode::DerivedFrom(unsigned long derivedid) { return(derivedid == Stringnode_id || node::DerivedFrom(derivedid)); } Stringnode::Stringnode(char *copyfrom = 0): (),stringdata(copyfrom) {} Stringnode::Stringnode(Stringnode &sn): (sn),stringdata(sn.stringdata) {} Stringnode &Stringnode::operator=(Stringnode &sn) { if(this == &sn) return(*this); node::operator=(sn); stringdata = sn.stringdata; return(*this); } int Stringnode::Same(node *comparenode) { if(!comparenode) return(FALSE); if(Stringnode_id != comparenode->IdentifySelf()) return(FALSE); return(stringdata == ((Stringnode*)comparenode)->stringdata); } void Stringnode::Print(ostream &output) { output << stringdata; } Stringnode::~Stringnode() {}