frameworks/native/services/vr/performanced/unique_file.h

21 lines
446 B
C
Raw Normal View History

2025-08-25 08:17:13 +08:00
#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_