| 3290 | } |
| 3291 | |
| 3292 | Apto::String Avida::Viewer::Freezer::LoadAttachment(FreezerID entry_id, const Apto::String& name) |
| 3293 | { |
| 3294 | if (!IsValid(entry_id) || entry_id.type == GENOME) return ""; |
| 3295 | |
| 3296 | Apto::String rtn; |
| 3297 | Apto::String name_path = Apto::FileSystem::PathAppend(PathOf(entry_id), name); |
| 3298 | if (Apto::FileSystem::IsFile(name_path)) { |
| 3299 | // Open name file and read contents |
| 3300 | cFile file; |
| 3301 | file.Open((const char*)name_path, std::ios::in); |
| 3302 | cString line; |
| 3303 | if (!file.Eof() && file.ReadLine(line)) rtn = line; |
| 3304 | while (!file.Eof() && file.ReadLine(line)) { |
| 3305 | rtn += "\n"; |
| 3306 | rtn += line; |
| 3307 | } |
| 3308 | file.Close(); |
| 3309 | } |
| 3310 | return rtn; |
| 3311 | } |
| 3312 | |
| 3313 | |
| 3314 | |