1#ifndef ANDROID_DVR_PERFORMANCED_UNIQUE_FILE_H_ 2#define ANDROID_DVR_PERFORMANCED_UNIQUE_FILE_H_ 3 4#include <stdio.h> 5 6#include <memory> 7 8namespace android { 9namespace dvr { 10 11// Utility to manage the lifetime of a file pointer. 12struct FileDeleter { 13 void operator()(FILE* fp) { fclose(fp); } 14}; 15using UniqueFile = std::unique_ptr<FILE, FileDeleter>; 16 17} // namespace dvr 18} // namespace android 19 20#endif // ANDROID_DVR_PERFORMANCED_UNIQUE_FILE_H_ 21