Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/include/OpenImageIO/imageio.h
Original file line number Diff line number Diff line change
Expand Up @@ -985,12 +985,12 @@ class OIIO_API ImageInput {
/// A `unique_ptr` that will close and free the ImageInput when
/// it exits scope or is reset. The pointer will be empty if the
/// required writer was not able to be created.
static unique_ptr open (const std::string& filename,
OIIO_NODISCARD static unique_ptr open (const std::string& filename,
const ImageSpec *config = nullptr,
Filesystem::IOProxy* ioproxy = nullptr);

/// Create and open an ImageInput using a UTF-16 encoded wstring filename.
static unique_ptr open (const std::wstring& filename,
OIIO_NODISCARD static unique_ptr open (const std::wstring& filename,
const ImageSpec *config = nullptr,
Filesystem::IOProxy* ioproxy = nullptr) {
return open(Strutil::utf16_to_utf8(filename), config, ioproxy);
Expand Down Expand Up @@ -1143,10 +1143,10 @@ class OIIO_API ImageInput {
///
/// @returns
/// `true` upon success, or `false` upon failure.
virtual bool valid_file (const std::string& filename) const;
OIIO_NODISCARD_ERROR virtual bool valid_file (const std::string& filename) const;

/// Check valid file using a UTF-16 encoded wstring filename.
bool valid_file (const std::wstring& filename) const {
OIIO_NODISCARD_ERROR bool valid_file (const std::wstring& filename) const {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, too, should be OIIO_NODISCARD because the result is not an error status, it's just a bool value that tells you whether or not the file is valid.

return valid_file(Strutil::utf16_to_utf8(filename));
}

Expand Down
Loading