Hi Chris -- Typically, argument parsing removes arguments from the
command line, leaving only files, then readNodeFiles is called. That's
all correct and fine.
However, what happens if the user specifies a bogus argument? The
argument parser doesn't remove it from the command line (because it
doesn't recognize it), and it gets passed to readNodeFiles, right? Is
your change able to handle a stray bogus command line argument? I assume
the "ignore files starting with '-'" code was there just to handle a
case like I'm describing.
I believe current readNodeFiles silently ignores anything it doesn't
recognize, so we're probably OK.
Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466
Chris 'Xenon' Hanson wrote:
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.
------------------------------------------------------------------------
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org