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

Revision 10174, 1.6 kB (checked in by robert, 5 years ago)

Moved Registry::ReadFileCallback? + WriteFileCallback?, and osgDB::ReaderWriter::Options into their own separate Options file and into the osgDB namespace.

Introduced a new callback osgDB::FindFileCallback? that overrides the default behavior of findDataFile/findLibraryFile.

Introduced support for assigning ReaderWriter::Options directory to PagedLOD.

Introduced new osgDB::FileLocationCallback? for assistancing the DatabasePager? to know when a file is hosted on a local or remote file system.

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 bool isFileAppropriateForFileCache(const std::string& originalFileName) const;
32
33        virtual std::string createCacheFileName(const std::string& originalFileName) const;
34
35        virtual bool existsInCache(const std::string& originalFileName) const;
36
37        virtual ReaderWriter::ReadResult readNode(const std::string& originalFileName, const osgDB::Options* options, bool buildKdTreeIfRequired=true) const;
38
39        virtual ReaderWriter::WriteResult writeNode(const osg::Node& node, const std::string& originalFileName, const osgDB::Options* options) const;
40
41    protected:
42
43        virtual ~FileCache();
44
45        std::string _fileCachePath;
46
47};
48
49}
50
51#endif
Note: See TracBrowser for help on using the browser.