libcamera: yaml_parser: Switch from FILE to File
THe FILE object isn't very user-friendly as it requires manual close. Replace it with File to provide RAII-style resource management in the YamlParser API. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdio>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -18,6 +17,7 @@
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
class File;
|
||||
class YamlParserContext;
|
||||
|
||||
class YamlObject
|
||||
@@ -82,7 +82,7 @@ private:
|
||||
class YamlParser final
|
||||
{
|
||||
public:
|
||||
static std::unique_ptr<YamlObject> parse(std::FILE *fh);
|
||||
static std::unique_ptr<YamlObject> parse(File &file);
|
||||
};
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
Reference in New Issue
Block a user