Hi all, I finally made time to integrate tinyformat into OIIO to give us typesafe formatting.
All varargs error() functions are replaced here by an equivalent function using tfm::format to do the formatting instead. An effort has been made to keep implementation details out of the headers by introducing private non-formatting functions like ImageInput::append_error() to be called by error(). tfm::format has been brought into the Strutil namespace to replace Strutil::format(). It's not entirely clear to me that this is the right thing (rather than just changing things to use tfm::format directly) but it is the simplest approach. Opinions welcome. Strutil::vformat() remains as-is, because it is useful in certain circumstances where external libraries pass a va_list. The error formatters inside ErrorHandler have not been changed yet, since it's not quite clear what to replace the va_list functions like ErrorHandler::vError() with, though I don't see that we're actually using ErrorHandler for anything! You can merge this Pull Request by running: git pull https://github.com/c42f/oiio tinyformat Or you can view, comment on it, or merge it online at: https://github.com/OpenImageIO/oiio/pull/324 -- Commit Summary -- * Use tinyformat for typesafe printf-like formatting -- File Changes -- M src/include/argparse.h (14) M src/include/errorhandler.h (8) M src/include/imageio.h (14) M src/include/strutil.h (8) A src/include/tinyformat.h (926) M src/include/ustring.h (7) M src/libOpenImageIO/imageinput.cpp (7) M src/libOpenImageIO/imageio.cpp (9) M src/libOpenImageIO/imageio_pvt.h (9) M src/libOpenImageIO/imageoutput.cpp (7) M src/libtexture/imagecache.cpp (7) M src/libtexture/imagecache_pvt.h (7) M src/libtexture/texture_pvt.h (7) M src/libtexture/texturesys.cpp (7) M src/libutil/argparse.cpp (9) M src/libutil/strutil.cpp (12) M src/libutil/ustring.cpp (38) -- Patch Links -- https://github.com/OpenImageIO/oiio/pull/324.patch https://github.com/OpenImageIO/oiio/pull/324.diff --- Reply to this email directly or view it on GitHub: https://github.com/OpenImageIO/oiio/pull/324 _______________________________________________ Oiio-dev mailing list [email protected] http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
