Added support for listing contents of archive
This commit is contained in:
parent
48191bb1ab
commit
2b8140e125
@ -140,7 +140,15 @@ int main( int argc, char **argv )
|
||||
|
||||
if (list)
|
||||
{
|
||||
std::cout<<"Cannot list at present."<<std::endl;
|
||||
std::cout<<"List of files in archive:"<<std::endl;
|
||||
const osgDB::Archive::FileNamePositionMap& indexMap = archive.getFileNamePositionMap();
|
||||
for(osgDB::Archive::FileNamePositionMap::const_iterator itr=indexMap.begin();
|
||||
itr!=indexMap.end();
|
||||
++itr)
|
||||
{
|
||||
std::cout<<" "<<itr->first<<"\t"<<itr->second<<std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,6 +55,10 @@ class OSGDB_EXPORT Archive : public ReaderWriter
|
||||
/** return true if file exists in archive.*/
|
||||
virtual bool fileExists(const std::string& filename) const;
|
||||
|
||||
typedef std::istream::pos_type pos_type;
|
||||
typedef std::map<std::string, pos_type> FileNamePositionMap;
|
||||
|
||||
const FileNamePositionMap& getFileNamePositionMap() const { return _indexMap; }
|
||||
|
||||
virtual ReadResult readObject(const std::string& fileName,const Options* options=NULL);
|
||||
virtual ReadResult readImage(const std::string& fileName,const Options* options=NULL);
|
||||
@ -69,8 +73,6 @@ class OSGDB_EXPORT Archive : public ReaderWriter
|
||||
protected:
|
||||
|
||||
|
||||
typedef std::istream::pos_type pos_type;
|
||||
typedef std::map<std::string, pos_type> FileNamePositionMap;
|
||||
|
||||
class IndexBlock : public osg::Referenced
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user