This interface is useful for testing, but is inconvenient for end users as they first must create a stream from an actual file. The load() interface should be overloaded that takes a filename as an argument instead a stream. It would open the file to create a stream and then call the original load() and then close the file. You can see the pattern in the examples.
The examples should then be updated to use the simpler interface.
Currently, the Parser class has a single interface for loading a config:
https://github.com/Goddard-Fortran-Ecosystem/yaFyaml/blob/6b9a50eb7000a600c9816c63abc8c84075771a33/src/Parser.F90#L90-L104
This interface is useful for testing, but is inconvenient for end users as they first must create a stream from an actual file. The
load()
interface should be overloaded that takes a filename as an argument instead a stream. It would open the file to create a stream and then call the originalload()
and then close the file. You can see the pattern in the examples.The examples should then be updated to use the simpler interface.