Files
FlaxEngine/Source/Engine/Platform/Mac/MacFileSystemWatcher.h
Andrew Spiering f40657ea04 macOS support fixes
* Adding macOS FileSystemWatcher, this should allow files to be monitored and update like the other OSs
* Reworked how macOS launches processes to use NSTask which just deals with escaped and unescaped paths better
* Made a change to the ScriptsBuilder::RunBuildTool, this was adding the escaped values to the path, in reality it should be up to the underlying OS to make sure things are properly escaped, so removed those as they just end up causing issues. Also instead of appending the args to the fileName we just properly use the Arguments variable on the CreateProcessSettings
* No longer use open in order to show files in the finder, we use the proper method selectFile
* made a slight cleanup change to the MacPlatform Tick function
* Added ToNSString functions just to make that easier
* Added a ParseArguments function that will take a string and turn it into an array for NSTask
2023-09-19 20:58:12 -07:00

40 lines
1018 B
C++

// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
#pragma once
#if PLATFORM_MAC
#include "Engine/Platform/Base/FileSystemWatcherBase.h"
#include <CoreServices/CoreServices.h>
/// <summary>
/// Mac platform implementation of the file system watching object.
/// </summary>
class FLAXENGINE_API MacFileSystemWatcher : public FileSystemWatcherBase
{
public:
/// <summary>
/// Initializes a new instance of the <see cref="MacFileSystemWatcher"/> class.
/// </summary>
/// <param name="directory">The directory to watch.</param>
/// <param name="withSubDirs">True if monitor the directory tree rooted at the specified directory or just a given directory.</param>
MacFileSystemWatcher(const String& directory, bool withSubDirs);
/// <summary>
/// Finalizes an instance of the <see cref="MacFileSystemWatcher"/> class.
/// </summary>
~MacFileSystemWatcher();
public:
private:
FSEventStreamRef EventStream;
bool IsRunning;
};
#endif