void PainterTest_App::OpenFileSpec(const ZFileSpec& inFileSpec) { #if 0 // debugging. -ec 06.02.23 ZAlert::sCautionAlert("Debugging OpenFileSpec()", "inFileSpec = '" + inFileSpec.AsString() + "'", "blah blah blah", 60 * ZTicks::sPerSecond()); #endif // in this scenario, if inFileSpec has a PainterTest_Window that is already open for it, then simply bring that window to the front. // note that if the file described by inFileSpec has been modified, those modifications will *not* be reflected in window Ð and will // be lost if window is saved. -ec 06.02.21 if (PainterTest_Window* theWindow = this->GetPainterWindow(inFileSpec)) { theWindow->BringFront(); theWindow->GetWindowLock().Release(); return; } if (ZRef<ZStreamerRPos> theStreamerRPos = inFileSpec.OpenRPos(false)) { string format; if (ZRef<NPaintDataRep> thePaintDataRep = sRead_NPaintDataRep(theStreamerRPos->GetStreamRPos(), format)) { PainterTest_Window* theWindow = new PainterTest_Window(this, fAsset.GetChild("Windows").GetChild("Painter"), fPaintState, thePaintDataRep, inFileSpec, format); theWindow->Center(); theWindow->BringFront(); theWindow->GetWindowLock().Release(); } } }
void ZASParser::ParseHandler_Prettify::EnterInclude(const ZFileSpec& iFileSpec) { sWriteIndent(fStrimW, fIndent); fStrimW.Write("// -----> enter file \""); string fileAsString = iFileSpec.AsString(); sWriteEscapifiedString(fStrimW, fileAsString); fStrimW.Write("\"\n"); fIncludes.push_back(fileAsString); }
// Utility function in place of ZFileSpec::operator==(const ZFileSpec& iOther). static bool sFileSpec_Equal(const ZFileSpec& iFS1, const ZFileSpec& iFS2) { return ZUnicode::sToLower(iFS1.AsString()) == ZUnicode::sToLower(iFS2.AsString()); }