MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / GetFilenameAndPathForSaveState

Method GetFilenameAndPathForSaveState

source/Disk.cpp:758–781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756}
757
758void Disk2InterfaceCard::GetFilenameAndPathForSaveState(std::string& filename, std::string& path)
759{
760 filename = "";
761 path = "";
762
763 for (UINT i=DRIVE_1; i<=DRIVE_2; i++)
764 {
765 if (IsDriveEmpty(i))
766 continue;
767
768 filename = GetBaseName(i);
769 std::string pathname = DiskGetFullPathName(i);
770
771 size_t idx = pathname.find_last_of(PATH_SEPARATOR);
772 if (idx >= 0 && idx+1 < (int)pathname.length()) // path exists?
773 {
774 path = pathname.substr(0, idx+1);
775 return;
776 }
777
778 _ASSERT(0);
779 break;
780 }
781}
782
783const std::string & Disk2InterfaceCard::DiskGetFullPathName(const int drive)
784{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected