HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImfCheckFile.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: BSD-3-Clause
2 // Copyright (c) Contributors to the OpenEXR Project.
3 
4 #ifndef INCLUDED_IMF_CHECKFILE_H
5 #define INCLUDED_IMF_CHECKFILE_H
6 
7 #include "ImfNamespace.h"
8 #include "ImfUtilExport.h"
9 
10 #include <cstddef>
11 
13 
14 //
15 // attempt to read the given file as an OpenEXR, using various OpenEXR read paths.
16 // This can be used to validate correctness of the library, when running the library
17 // with a sanitizer or memory checker, as well as checking that a file is a correct OpenEXR
18 //
19 // returns true if the file reads correctly using expected API calls, or false
20 // if an exception was thrown that indicates the file is invalid
21 //
22 // if reduceMemory is true, will avoid tests or inputs that are known to
23 // take large amounts of memory. This may hide errors within the file or library.
24 //
25 // if reduceTime is true and an error is found within the file, then future tests are reduced for speed.
26 // This may hide errors within the library.
27 //
28 // if runCoreCheck is true, only uses the OpenEXRCore (C) API, otherwise uses the OpenEXR (C++) API
29 //
30 
32  const char* fileName,
33  bool reduceMemory = false,
34  bool reduceTime = false,
35  bool runCoreCheck = false);
36 
37 //
38 // overloaded version of checkOpenEXRFile that takes a pointer to in-memory data
39 //
40 
42  const char* data,
43  size_t numBytes,
44  bool reduceMemory = false,
45  bool reduceTime = false,
46  bool runCoreCheck = false);
47 
49 
50 #endif
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Definition: ImfNamespace.h:83
#define IMFUTIL_EXPORT
Definition: ImfUtilExport.h:51
#define OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Definition: ImfNamespace.h:80
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER IMFUTIL_EXPORT bool checkOpenEXRFile(const char *fileName, bool reduceMemory=false, bool reduceTime=false, bool runCoreCheck=false)
Definition: format.h:895