From Chris Hanson, " Remove vestigial (and because it was undocumented, potentially harmful) code to ignore
filenames starting with a dash "-" character from the (std::vector<std::string>&) version of osgDB::readNodeFiles. Handling of argument strings is properly implemented in the osgDB::readNodeFiles(osg::ArgumentParser& arguments,const Options* options) variant, which most code uses. The (std::vector<std::string>&) version is only called by the osgconv utility, which does its own argument handling and stripping prior to calling readNodeFiles(). Also, documented this behaviour in the header comments. I believe this code removal is a meritful change because leavign the code in causes an unexpected and undocumented behaviour (ignoring any filename starting with a dash) that could bite users in the future. This behaviour is not needed for existing functionality because existing code uses other APIs to handle dash-prefixed arguments anyway. "
This commit is contained in:
@@ -109,14 +109,15 @@ inline osg::Node* readNodeFile(const std::string& filename)
|
||||
|
||||
/** Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more
|
||||
* than one subgraph has been loaded.
|
||||
* Use the Options object to control cache operations and file search paths in osgDB::Registry.*/
|
||||
extern OSGDB_EXPORT osg::Node* readNodeFiles(std::vector<std::string>& commandLine,const Options* options);
|
||||
* Use the Options object to control cache operations and file search paths in osgDB::Registry.
|
||||
* Does NOT ignore strings beginning with a dash '-' character. */
|
||||
extern OSGDB_EXPORT osg::Node* readNodeFiles(std::vector<std::string>& fileList,const Options* options);
|
||||
|
||||
/** Read an osg::Node subgraph from files, creating a osg::Group to contain the nodes if more
|
||||
* than one subgraph has been loaded.*/
|
||||
inline osg::Node* readNodeFiles(std::vector<std::string>& commandLine)
|
||||
inline osg::Node* readNodeFiles(std::vector<std::string>& fileList)
|
||||
{
|
||||
return readNodeFiles(commandLine,Registry::instance()->getOptions());
|
||||
return readNodeFiles(fileList,Registry::instance()->getOptions());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user