CoreServices: add fs_event_stream

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2025-06-20 10:23:46 +02:00
parent 21784a36dd
commit ac9ba6919a

View File

@ -0,0 +1,34 @@
/*
SPDX-License-Identifier: MIT
Copyright © 2025 Amebis
*/
#pragma once
#include "common.hpp"
#include <CoreServices/CoreServices.h>
namespace macstd {
///
/// FS event stream traits
///
struct fs_event_stream_traits
{
static inline constexpr FSEventStreamRef invalid = static_cast<FSEventStreamRef>(NULL);
///
/// Releases an object handle
///
/// \sa [FSEventStreamRelease function](https://developer.apple.com/documentation/coreservices/1445989-fseventstreamrelease)
///
static void free(FSEventStreamRef h) noexcept
{
FSEventStreamRelease(h);
}
private:
static FSEventStreamRef duplicate(FSEventStreamRef h);
};
using fs_event_stream = handle<FSEventStreamRef, fs_event_stream_traits>;
}