23 lines
415 B
C++
23 lines
415 B
C++
//
|
|
// Created by Shell on 2026-04-13.
|
|
//
|
|
|
|
#ifndef SEADISK_ICU_RAII_H
|
|
#define SEADISK_ICU_RAII_H
|
|
#include <unicode/ucsdet.h>
|
|
|
|
struct UCharsetDetectorDeleter final
|
|
{
|
|
void operator ()(UCharsetDetector* ptr) const
|
|
{
|
|
if (ptr)
|
|
{
|
|
ucsdet_close(ptr);
|
|
}
|
|
}
|
|
};
|
|
|
|
using UCharsetDetectorPtr = std::unique_ptr<UCharsetDetector, UCharsetDetectorDeleter>;
|
|
|
|
#endif //SEADISK_ICU_RAII_H
|