root/OpenSceneGraph/trunk/src/osgDB/Options.cpp @ 13041

Revision 13041, 2.0 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
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#include <osgDB/Options>
15#include <osgDB/Registry>
16
17using namespace osgDB;
18
19Options::Options(const Options& options,const osg::CopyOp& copyop):
20    osg::Object(options,copyop),
21    _str(options._str),
22    _databasePaths(options._databasePaths),
23    _objectCacheHint(options._objectCacheHint),
24    _precisionHint(options._precisionHint),
25    _buildKdTreesHint(options._buildKdTreesHint),
26    _pluginData(options._pluginData),
27    _pluginStringData(options._pluginStringData),
28    _findFileCallback(options._findFileCallback),
29    _readFileCallback(options._readFileCallback),
30    _writeFileCallback(options._writeFileCallback),
31    _fileLocationCallback(options._fileLocationCallback),
32    _fileCache(options._fileCache),
33    _terrain(options._terrain) {}
34
35void Options::parsePluginStringData(const std::string& str, char separator1, char separator2)
36{
37    StringList valueList;
38    split(str, valueList, separator1);
39    if (valueList.size() > 0)
40    {
41        StringList keyAndValue;
42        for (StringList::iterator itr=valueList.begin(); itr!=valueList.end(); ++itr)
43        {
44            split(*itr, keyAndValue, separator2);
45            if (keyAndValue.size() > 1)
46            {
47                setPluginStringData(keyAndValue.front(), keyAndValue.back());
48            }
49            else if (keyAndValue.size() > 0)
50            {
51                setPluginStringData(keyAndValue.front(), "true");
52            }
53            keyAndValue.clear();
54        }
55    }
56}
Note: See TracBrowser for help on using the browser.