CoreServices: add fs_event_stream
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
21784a36dd
commit
ac9ba6919a
34
include/MacStd/CoreServices.hpp
Normal file
34
include/MacStd/CoreServices.hpp
Normal 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>;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user