Logo Search packages:      
Sourcecode: einstein version File versions  Download package

void ResourceFile::getDirectory ( Directory &  directory  )  [inherited]

Load directory listing.

Parameters:
directory list where resource entries will be placed.

Definition at line 175 of file resources.cpp.

{
    stream.seekg(-8, std::ios::end);
    if (stream.fail())
        throw Exception(L"Error reading " + name + L" directory");
    int start = readInt(stream);
    int count = readInt(stream);
    stream.seekg(start, std::ios::beg);
    if (stream.fail())
        throw Exception(L"Error reading " + name + L" directory");

    for (int i = 0; i < count; i++) {
        DirectoryEntry entry;
        entry.name = readString(stream);
        entry.unpackedSize = readInt(stream);
        entry.offset = readInt(stream);
        entry.packedSize = readInt(stream);
        entry.level = readInt(stream);
        entry.group = readString(stream);
        directory.push_back(entry);
    }
    
    if (stream.fail())
        throw Exception(L"Error reading " + name + L" directory");
}


Generated by  Doxygen 1.6.0   Back to index