root/OpenSceneGraph/trunk/include/osgDB/FileCache @ 10171

Revision 10171, 1.5 kB (checked in by robert, 6 years ago)

Refactored the Registry::ReadFileCallback?, WriteFileCallback? and ReaderWriter::Options to they are now defined in their own header and in the osgDB namespace.

Introduced a new FindFileCallback? to Registry to compliement the existing ReadFileCallback? and WriteFileCallback?.

Added support for assign Find, Read and WriteFileCallbacks? to osdDB::Options to enable plugins/applications to override the callbacks just for that
read/write call and any nested file operations

Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under 
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSGDB_FILECACHE
15#define OSGDB_FILECACHE 1
16
17#include <osg/Node>
18
19#include <osgDB/ReaderWriter>
20
21namespace osgDB {
22
23class OSGDB_EXPORT FileCache : public osg::Referenced
24{
25    public:
26
27        FileCache(const std::string& path);
28
29        const std::string& getFileCachePath() const { return _fileCachePath; }
30
31        virtual std::string createCacheFileName(const std::string& originalFileName) const;
32
33        virtual bool existsInCache(const std::string& originalFileName) const;
34
35        virtual ReaderWriter::ReadResult readNode(const std::string& originalFileName, const osgDB::Options* options, bool buildKdTreeIfRequired=true) const;
36
37        virtual ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& originalFileName, const osgDB::Options* options) const;
38
39    protected:
40
41        virtual ~FileCache();
42
43        std::string _fileCachePath;
44
45};
46
47}
48
49#endif
Note: See TracBrowser for help on using the browser.