virtual void Execute() final override { char* name = AskUser(); if (0 != name) { Document* document = new Document(name); _application->Add(document); document->Open(); } }
void OpenCommand::Execute() { const char* name = AskUser(); if(name != NULL) { Document* document = new Document(name); _application->Add(document); document->Open(); } }
void Application::OpenDocument (const char* name) { if (!CanOpenDocument(name)) { // cannot handle this document return; } /* */ Document* doc = DoCreateDocument(); if (doc) { _docs->Append(*doc); AboutToOpenDocument(doc); doc->Open(); doc->DoRead(); } }
void NewDocument(char* pFileName) { Document *pDoc = CreateDocument(GetDocType(pFileName)); if (pDoc == NULL) exit(0); docs_[pFileName] = pDoc; pDoc->Open(pFileName); }