Re: Review: Add config.sanityCheck


Malcolm Humphreys <malcolmh...@...>
 

Could we call this config.validate(), I know we are all a bit insane ;)

enum ConfigValid
{
    CONFIG_UNKNOWN = 0,
    CONFIG_VALID,
    CONFIG_INVALID
}

What do you think about not throwing an exception but returning the enum and the error text?

something like:
OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
if(config.validate(&errstr) == CONFIG_INVALID)
    // do something sane
.malcolm


On 21 Dec, 2010,at 01:26 PM, Jeremy Selan <jere...@...> wrote:

This will prevent the issues Blake encountered from happening again.
http://groups.google.com/group/ocio-dev/browse_thread/thread/c073e0f4fde995f7

This also addresses an outstanding issue:
https://github.com/imageworks/OpenColorIO/issues#issue/17

* Configs get a 'sanityCheck' call, which will validate the
configuration and throw an exception if any errors are detected. An
example of an error condition would be a role reference to a
colorspace that does not exist. Repeated calls to sanityCheck are
cached (and fast).

* Nuke plugins call sanityCheck() before the getProcessor() call.

* getColorSpace call is now not sensitive to case differences. Aka,
linear == LINEAR.

* The default role is only returned as the colorspace of 'last resort'
if strict_parsing is explicitly disabled. This will prevent
colorspace errors to silently roll by, unless requested.

Commits:
2ae25fc437
993773f9ad
3607e94d29

-- Jeremy

Join ocio-dev@lists.aswf.io to automatically receive all group messages.