From fca5f2c2c968b257025f532fbe4f903b906896f7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 26 Oct 2004 10:27:00 +0000 Subject: [PATCH] Updates to the osgarchive application --- examples/osgarchive/osgarchive.cpp | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/examples/osgarchive/osgarchive.cpp b/examples/osgarchive/osgarchive.cpp index b4db03bdf..0fdef8bbf 100644 --- a/examples/osgarchive/osgarchive.cpp +++ b/examples/osgarchive/osgarchive.cpp @@ -13,6 +13,8 @@ #include #include +#include +#include #include @@ -91,8 +93,56 @@ int main( int argc, char **argv ) std::cout<<"Please specify an operation on the archive, either --insert, --extract or --list"< obj = osgDB::readObjectFile(*itr); + if (obj.valid()) + { + archive.writeObject(*obj, *itr); + } + } + } + else + { + archive.open(archiveFilename,osgDB::Archive::READ); + + if (extract) + { + for (FileNameList::iterator itr=files.begin(); + itr!=files.end(); + ++itr) + { + osg::ref_ptr obj = osgDB::readObjectFile(*itr); + if (obj.valid()) + { + if (obj.valid()) osgDB::writeObjectFile(*obj, *itr); + } + } + } + } + + if (list) + { + std::cout<<"Cannot list at present."<