Skip to content

Commit

Permalink
Added vsg::getFeatures(..) function to make it more convinient to che…
Browse files Browse the repository at this point in the history
…ck all the ReaderWriter features available via the vsg::Options::readerWriters list.
  • Loading branch information
robertosfield committed Oct 14, 2024
1 parent c6a8e46 commit ebc7d2f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/vsg/io/ReaderWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,7 @@ namespace vsg
};
VSG_type_name(vsg::CompositeReaderWriter);

/// Get the Features supported by the ReaderWriters assigned to Options object.
extern VSG_DECLSPEC bool getFeatures(ref_ptr<const Options> options, ReaderWriter::Features& features);

} // namespace vsg
12 changes: 12 additions & 0 deletions src/vsg/io/ReaderWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,15 @@ bool CompositeReaderWriter::getFeatures(Features& features) const
}
return result;
}

bool vsg::getFeatures(ref_ptr<const Options> options, ReaderWriter::Features& features)
{
if (!options) return false;

bool result = false;
for (auto& rw : options->readerWriters)
{
if (rw->getFeatures(features)) result = true;
}
return result;
}

0 comments on commit ebc7d2f

Please sign in to comment.