Skip to content

Commit 55dd7f7

Browse files
committed
chore: clean up
1 parent caefc38 commit 55dd7f7

File tree

21 files changed

+102
-1390
lines changed

21 files changed

+102
-1390
lines changed

binding.gyp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@
2828
"native-src/sync_root_interface/callbacks/FetchData/TransferContext.cpp",
2929
"native-src/sync_root_interface/callbacks/FetchPlaceholder/FetchPlaceholder.cpp",
3030
"native-src/sync_root_interface/callbacks/NotifyDelete/NotifyDeleteCallback.cpp",
31-
"native-src/sync_root_interface/callbacks/NotifyFileAdded/NotifyFileAddedCallback.cpp",
32-
"native-src/sync_root_interface/callbacks/NotifyMessage/NofifyMessageCallback.cpp",
3331
"native-src/sync_root_interface/callbacks/NotifyRename/NotifyRenameCallback.cpp",
34-
"native-src/sync_root_watcher/DirectoryWatcher.cpp",
35-
"native-src/sync_root_watcher/SyncRootWatcher.cpp",
3632
"native-src/virtual_drive/Wrappers.cpp"
3733
],
3834
"include_dirs": [
@@ -41,7 +37,6 @@
4137
"include/placeholders_interface",
4238
"include/sync_root_interface",
4339
"include/sync_root_interface/callbacks",
44-
"include/sync_root_watcher",
4540
"include/types",
4641
"include/virtual_drive"
4742
],

include/placeholders_interface/PlaceHolderInfo.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ enum class PinState
2525
Excluded = 4,
2626
};
2727

28-
28+
struct FileState {
29+
PinState pinstate;
30+
SyncState syncstate;
31+
};
2932

3033
class PlaceHolderInfo
3134
{

include/placeholders_interface/Placeholders.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ class Placeholders
4848
static std::string GetFileIdentity(const std::wstring &filePath);
4949
static void UpdateFileIdentity(const std::wstring &filePath, const std::wstring &fileIdentity, bool isDirectory);
5050
static PlaceholderAttribute GetAttribute(const std::wstring &filePath);
51+
static FileState GetPlaceholderInfo(const std::wstring &directoryPath);
5152
};

include/sync_root_interface/Utilities.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class Utilities
1010
static void ApplyCustomOverwriteStateToPlaceholderFile(_In_ LPCWSTR path, _In_ LPCWSTR filename, _In_ winrt::StorageProviderItemProperty &prop);
1111
static std::wstring ProcessErrorNameToWString(_In_ ProcessErrorName error);
1212
static std::wstring FileOperationErrorToWString(_In_ FileOperationError error);
13+
static bool IsTemporaryFile(const std::wstring &fullPath);
1314

1415
static winrt::com_array<wchar_t>
1516
ConvertSidToStringSid(_In_ PSID sid)

include/sync_root_interface/callbacks/Callbacks.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#pragma once
22

33
#include <CallbacksContext.h>
4-
#include "DirectoryWatcher.h"
54

65
void register_threadsafe_callbacks(napi_env env, InputSyncCallbacks input);
76

@@ -24,11 +23,3 @@ void CALLBACK fetch_data_callback_wrapper(_In_ CONST CF_CALLBACK_INFO *callbackI
2423
// Fetch Data Cancel Callback
2524
void register_threadsafe_cancel_fetch_data_callback(const std::string &resource_name, napi_env env, InputSyncCallbacks input);
2625
void CALLBACK cancel_fetch_data_callback_wrapper(_In_ CONST CF_CALLBACK_INFO *callbackInfo, _In_ CONST CF_CALLBACK_PARAMETERS *callbackParameters);
27-
28-
// Notify File Added Callback. This is a fake callback
29-
void notify_file_added_call(napi_env env, napi_value js_callback, void *context, void *data);
30-
void register_threadsafe_notify_file_added_callback(FileChange &change, const std::string &resource_name, napi_env env, InputSyncCallbacksThreadsafe input);
31-
32-
// Notify message from node-win
33-
void notify_message_call(napi_env env, napi_value js_callback, void *context, void *data);
34-
void register_threadsafe_message_callback(FileChange &change, const std::string &resource_name, napi_env env, InputSyncCallbacksThreadsafe input);

include/sync_root_watcher/DirectoryWatcher.h

Lines changed: 0 additions & 64 deletions
This file was deleted.

include/sync_root_watcher/DownloadMutexManager.h

Lines changed: 0 additions & 46 deletions
This file was deleted.

include/sync_root_watcher/SyncRootWatcher.h

Lines changed: 0 additions & 44 deletions
This file was deleted.

include/virtual_drive/Wrappers.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ napi_value CreatePlaceholderFile(napi_env env, napi_callback_info args);
66
napi_value UnregisterSyncRootWrapper(napi_env env, napi_callback_info args);
77
napi_value RegisterSyncRootWrapper(napi_env env, napi_callback_info args);
88
napi_value ConnectSyncRootWrapper(napi_env env, napi_callback_info args);
9-
napi_value WatchAndWaitWrapper(napi_env env, napi_callback_info args);
109
napi_value CreateEntryWrapper(napi_env env, napi_callback_info args);
1110
napi_value DisconnectSyncRootWrapper(napi_env env, napi_callback_info args);
1211
napi_value GetFileIdentityWrapper(napi_env env, napi_callback_info args);
@@ -15,7 +14,6 @@ napi_value UpdateSyncStatusWrapper(napi_env env, napi_callback_info args);
1514
napi_value GetPlaceholderStateWrapper(napi_env env, napi_callback_info args);
1615
napi_value GetPlaceholderWithStatePendingWrapper(napi_env env, napi_callback_info args);
1716
napi_value ConvertToPlaceholderWrapper(napi_env env, napi_callback_info args);
18-
napi_value CloseMutexWrapper(napi_env env, napi_callback_info args);
1917
napi_value DeleteFileSyncRootWrapper(napi_env env, napi_callback_info args);
2018
napi_value UpdateFileIdentityWrapper(napi_env env, napi_callback_info args);
2119
napi_value DehydrateFileWrapper(napi_env env, napi_callback_info args);

native-src/main.cpp

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,6 @@
33

44
napi_value init(napi_env env, napi_value exports)
55
{
6-
// Watcher
7-
napi_property_descriptor watchAndWaitDesc = {
8-
"watchAndWait", // nombre de la función en JS
9-
nullptr,
10-
WatchAndWaitWrapper, // nombre de tu función en C++
11-
nullptr,
12-
nullptr,
13-
nullptr,
14-
napi_default,
15-
nullptr};
16-
17-
napi_status defineWatchAndWaitStatus = napi_define_properties(env, exports, 1, &watchAndWaitDesc);
18-
if (defineWatchAndWaitStatus != napi_ok)
19-
{
20-
napi_throw_error(env, nullptr, "Failed to define WatchAndWait function");
21-
return nullptr;
22-
}
23-
246
// CreatePlaceholderFileWrapper
257
napi_property_descriptor desc = {
268
"createPlaceholderFile",
@@ -247,23 +229,6 @@ napi_value init(napi_env env, napi_value exports)
247229
return nullptr;
248230
}
249231

250-
napi_property_descriptor closeMutexDesc = {
251-
"closeMutex",
252-
nullptr,
253-
CloseMutexWrapper,
254-
nullptr,
255-
nullptr,
256-
nullptr,
257-
napi_default,
258-
nullptr};
259-
260-
napi_status closeMutexStatus = napi_define_properties(env, exports, 1, &closeMutexDesc);
261-
if (closeMutexStatus != napi_ok)
262-
{
263-
napi_throw_error(env, nullptr, "Failed to define closeMutex function");
264-
return nullptr;
265-
}
266-
267232
napi_property_descriptor updateFileIdentityDesc = {
268233
"updateFileIdentity",
269234
nullptr,

0 commit comments

Comments
 (0)