forked from AcademySoftwareFoundation/openexr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add website source files to CMake for validation
- Include all .cpp files in `docs/src` in `docs/src/all.cpp` and add it as a build dependency. This validates that it compiles, although there's no execution so it still doesn't validate correct behavior. - Move larger code-blocks from ReadingAndWritingImageFiles.rst into individual files in `docs/src` Signed-off-by: Cary Phillips <[email protected]>
- Loading branch information
Showing
22 changed files
with
308 additions
and
263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright (c) Contributors to the OpenEXR Project. | ||
|
||
add_executable(docs_src all.cpp) | ||
target_link_libraries(docs_src OpenEXR::OpenEXR) | ||
set_target_properties(docs_src PROPERTIES | ||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" | ||
) | ||
if(WIN32 AND BUILD_SHARED_LIBS) | ||
target_compile_definitions(docs_src PRIVATE OPENEXR_DLL) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class C_IStream: public IStream | ||
{ | ||
public: | ||
C_IStream (FILE *file, const char fileName[]): | ||
IStream (fileName), _file (file) {} | ||
|
||
virtual bool read (char c[], int n); | ||
virtual uint64_t tellg (); | ||
virtual void seekg (uint64_t pos); | ||
virtual void clear (); | ||
|
||
private: | ||
|
||
FILE * _file; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
void | ||
C_IStream::clear () | ||
{ | ||
clearerr (_file); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
bool | ||
C_IStream::read (char c[], int n) | ||
{ | ||
if (n != static_cast <int> (fread (c, 1, n, _file))) | ||
{ | ||
// fread() failed, but the return value does not distinguish | ||
// between I/O errors and end of file, so we call ferror() to | ||
// determine what happened. | ||
|
||
if (ferror (_file)) | ||
Iex::throwErrnoExc(); | ||
else | ||
throw Iex::InputExc ("Unexpected end of file."); | ||
} | ||
|
||
return !feof (_file); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
void | ||
C_IStream::seekg (uint64_t pos) | ||
{ | ||
clearerr (_file); | ||
fseek (_file, pos, SEEK_SET); | ||
} | ||
|
Oops, something went wrong.