Translate C++ to D
Luca Lupo
luca.lupo at hotmail.it
Fri Jan 11 04:44:08 PST 2008
So, I have converted the -> with the . , but I must make this also for:
example:
Observer::~this(){} ??? :: no, but .??
And Exit the cout in D?? or I must import some library??
Thanks
//Observer.d
import std.string;
import Subject
Observer::~this() //distructor for observer
{}
Observer::this() // costructor for observer
{}
SubscriberG::this(string a) //contructor for subscriberG
{indirizzo_e_mail_G = a;}
SubscriberS::this(string a,string b) //contructor for subscriberS
{
indirizzo_e_mail_S = a;
name_author = b;
}
void Observer::Update(Subject* b) //it's equal? for me yes!
{}
void Subscriber::Update(Subject* b) //it's equal? for me yes!
{}
void SubscriberS::Update(Subject* b) //Help??
{
if(name_author == ((Blog *)b).GetAuthor()){
cout<<"Subscriber tipo S->"<<"Name blog: "<<((Blog *)b).GetName()<<endl;
((Blog *)b).GetTitle();
((Blog *)b).GetText();
cout<<"Autore Ultimo Post :"<<((Blog *)b).GetAuthor();
}
cout<<endl<<endl;
}
void SubscriberG::Update(Subject* b) //Help??
{
cout<<"Subscriber tipo G->"<<"Name blog: "<<((Blog *)b).GetName()<<endl;
((Blog *)b).GetTitle();
((Blog *)b).GetLine();
cout<<"Autore Ultimo Post :"<<((Blog *)b).GetAuthor();
cout<<endl<<endl;
}
More information about the Digitalmars-d
mailing list