blob: 86e487a83a3c8d6c2117cfd5dd11be57d87e9da7 [file] [log] [blame]
#ifndef ANDROID_DVR_PERFORMANCED_UNIQUE_FILE_H_
#define ANDROID_DVR_PERFORMANCED_UNIQUE_FILE_H_
#include <stdio.h>
#include <memory>
namespace android {
namespace dvr {
// Utility to manage the lifetime of a file pointer.
struct FileDeleter {
void operator()(FILE* fp) { fclose(fp); }
};
using UniqueFile = std::unique_ptr<FILE, FileDeleter>;
} // namespace dvr
} // namespace android
#endif // ANDROID_DVR_PERFORMANCED_UNIQUE_FILE_H_