file.cpp

changeset 168
96691a009dff
parent 164
8c93d8e38494
child 169
f562323760a2
equal deleted inserted replaced
167:df78c894ae24 168:96691a009dff
126 126
127 LDObject* obj = parseLine (data); 127 LDObject* obj = parseLine (data);
128 assert (obj != null); 128 assert (obj != null);
129 129
130 // Check for parse errors and warn about tthem 130 // Check for parse errors and warn about tthem
131 if (obj->getType() == OBJ_Gibberish) { 131 if (obj->getType() == LDObject::Gibberish) {
132 logf (LOG_Warning, "Couldn't parse line #%lu: %s\n", 132 logf (LOG_Warning, "Couldn't parse line #%lu: %s\n",
133 lnum, static_cast<LDGibberish*> (obj)->zReason.chars()); 133 lnum, static_cast<LDGibberish*> (obj)->zReason.chars());
134 134
135 logf (LOG_Warning, "- Line was: %s\n", data.chars()); 135 logf (LOG_Warning, "- Line was: %s\n", data.chars());
136 136
584 g_loadedFiles.clear (); 584 g_loadedFiles.clear ();
585 g_loadedFiles.push_back (g_curfile); 585 g_loadedFiles.push_back (g_curfile);
586 586
587 // Go through all objects in the current file and reload the subfiles 587 // Go through all objects in the current file and reload the subfiles
588 for (LDObject* obj : g_curfile->m_objs) { 588 for (LDObject* obj : g_curfile->m_objs) {
589 if (obj->getType() == OBJ_Subfile) { 589 if (obj->getType() == LDObject::Subfile) {
590 // Note: ref->pFile is invalid right now since all subfiles were closed. 590 // Note: ref->pFile is invalid right now since all subfiles were closed.
591 LDSubfile* ref = static_cast<LDSubfile*> (obj); 591 LDSubfile* ref = static_cast<LDSubfile*> (obj);
592 OpenFile* pFile = loadSubfile (ref->zFileName); 592 OpenFile* pFile = loadSubfile (ref->zFileName);
593 593
594 if (pFile) 594 if (pFile)
599 } 599 }
600 } 600 }
601 601
602 // Reparse gibberish files. It could be that they are invalid because 602 // Reparse gibberish files. It could be that they are invalid because
603 // the file could not be opened. Circumstances may be different now. 603 // the file could not be opened. Circumstances may be different now.
604 if (obj->getType() == OBJ_Gibberish) 604 if (obj->getType() == LDObject::Gibberish)
605 obj->replace (parseLine (static_cast<LDGibberish*> (obj)->zContents)); 605 obj->replace (parseLine (static_cast<LDGibberish*> (obj)->zContents));
606 } 606 }
607 } 607 }
608 608
609 // ============================================================================= 609 // =============================================================================

mercurial