Archive
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGDB_ARCHIVE
#define OSGDB_ARCHIVE 1
#include <osgDB/ReaderWriter>
#include <osgDB/Registry>
#include <osgDB/FileUtils>
#include <fstream>
#include <list>
namespace osgDB {
class OSGDB_EXPORT Archive : public ReaderWriter
{
public:
Archive();
virtual ~Archive();
virtual const char* libraryName() const { return "osgDB"; }
virtual const char* className() const { return "Archive"; }
virtual bool acceptsExtension(const std::string& /*extension*/) const { return true; }
virtual void close() = 0;
virtual std::string getArchiveFileName() const = 0;
virtual std::string getMasterFileName() const = 0;
virtual bool fileExists(const std::string& filename) const = 0;
virtual FileType getFileType(const std::string& filename) const = 0;
typedef osgDB::DirectoryContents FileNameList;
virtual bool getFileNames(FileNameList& fileNames) const = 0;
virtual DirectoryContents getDirectoryContents(const std::string& dirName) const;
virtual ReadResult readObject(const std::string& /*fileName*/,const Options* =NULL) const = 0;
virtual ReadResult readImage(const std::string& /*fileName*/,const Options* =NULL) const = 0;
virtual ReadResult readHeightField(const std::string& /*fileName*/,const Options* =NULL) const = 0;
virtual ReadResult readNode(const std::string& /*fileName*/,const Options* =NULL) const = 0;
virtual ReadResult readShader(const std::string& /*fileName*/,const Options* =NULL) const = 0;
virtual WriteResult writeObject(const osg::Object& /*obj*/,const std::string& /*fileName*/,const Options* =NULL) const = 0;
virtual WriteResult writeImage(const osg::Image& /*image*/,const std::string& /*fileName*/,const Options* =NULL) const = 0;
virtual WriteResult writeHeightField(const osg::HeightField& /*heightField*/,const std::string& /*fileName*/,const Options* =NULL) const = 0;
virtual WriteResult writeNode(const osg::Node& /*node*/,const std::string& /*fileName*/,const Options* =NULL) const = 0;
virtual WriteResult writeShader(const osg::Shader& /*shader*/,const std::string& /*fileName*/,const Options* =NULL) const = 0;
};
OSGDB_EXPORT Archive* openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint=4096);
OSGDB_EXPORT Archive* openArchive(const std::string& filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint,Options* options);
}
#endif // OSGDB_ARCHIVE
FileUtils
ReaderWriter
osgDB::Archive
Definition Archive:29
osgDB::Archive::writeNode
virtual WriteResult writeNode(const osg::Node &, const std::string &, const Options *=NULL) const =0
osgDB::Archive::Archive
Archive()
osgDB::Archive::readImage
virtual ReadResult readImage(const std::string &, const Options *=NULL) const =0
osgDB::Archive::writeHeightField
virtual WriteResult writeHeightField(const osg::HeightField &, const std::string &, const Options *=NULL) const =0
osgDB::Archive::close
virtual void close()=0
osgDB::Archive::readHeightField
virtual ReadResult readHeightField(const std::string &, const Options *=NULL) const =0
osgDB::Archive::libraryName
virtual const char * libraryName() const
Definition Archive:34
osgDB::Archive::writeImage
virtual WriteResult writeImage(const osg::Image &, const std::string &, const Options *=NULL) const =0
osgDB::Archive::FileNameList
osgDB::DirectoryContents FileNameList
Definition Archive:55
osgDB::Archive::writeShader
virtual WriteResult writeShader(const osg::Shader &, const std::string &, const Options *=NULL) const =0
osgDB::Archive::acceptsExtension
virtual bool acceptsExtension(const std::string &) const
Definition Archive:38
osgDB::Archive::fileExists
virtual bool fileExists(const std::string &filename) const =0
osgDB::Archive::readObject
virtual ReadResult readObject(const std::string &, const Options *=NULL) const =0
osgDB::Archive::readShader
virtual ReadResult readShader(const std::string &, const Options *=NULL) const =0
osgDB::Archive::className
virtual const char * className() const
Definition Archive:36
osgDB::Archive::readNode
virtual ReadResult readNode(const std::string &, const Options *=NULL) const =0
osgDB::Archive::getArchiveFileName
virtual std::string getArchiveFileName() const =0
osgDB::Archive::~Archive
virtual ~Archive()
osgDB::Archive::writeObject
virtual WriteResult writeObject(const osg::Object &, const std::string &, const Options *=NULL) const =0
osgDB::Archive::getDirectoryContents
virtual DirectoryContents getDirectoryContents(const std::string &dirName) const
osgDB::Archive::getFileNames
virtual bool getFileNames(FileNameList &fileNames) const =0
osgDB::Archive::getMasterFileName
virtual std::string getMasterFileName() const =0
osgDB::Archive::getFileType
virtual FileType getFileType(const std::string &filename) const =0
osgDB::Options
Definition Options:30
osgDB::ReaderWriter::ReadResult
Definition ReaderWriter:109
osgDB::ReaderWriter::WriteResult
Definition ReaderWriter:184
osgDB::ReaderWriter::Options
osgDB::Options Options
Definition ReaderWriter:227
osgDB::ReaderWriter::ArchiveStatus
ArchiveStatus
Definition ReaderWriter:221
osgDB::ReaderWriter::ReaderWriter
ReaderWriter()
Definition ReaderWriter:44
osg::HeightField
Definition Shape:483
osg::Image
Definition Image:179
osg::Node
Definition Node:72
osg::Object
Definition Object:61
osg::Shader
Definition Shader:89
fstream
osgDB
Definition Archive:24
osgDB::openArchive
OSGDB_EXPORT Archive * openArchive(const std::string &filename, ReaderWriter::ArchiveStatus status, unsigned int indexBlockSizeHint=4096)
osgDB::DirectoryContents
std::vector< std::string > DirectoryContents
Definition FileUtils:67
osgDB::FileType
FileType
Definition FileUtils:47
OSGDB_EXPORT
#define OSGDB_EXPORT
Definition osgDB/Export:39
Registry
NULL
#define NULL
Definition osg/Export:55