MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / internalAddNotification

Method internalAddNotification

Engine/source/platformWin32/winVolume.cpp:151–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149//-----------------------------------------------------------------------------
150
151bool Win32FileSystemChangeNotifier::internalAddNotification( const Path &dir )
152{
153 for ( U32 i = 0; i < mDirs.size(); ++i )
154 {
155 if ( mDirs[i] == dir )
156 return false;
157 }
158
159 Path fullFSPath = mFS->mapTo( dir );
160 String osPath = PathToOS( fullFSPath );
161
162// Con::printf( "[Win32FileSystemChangeNotifier::internalAddNotification] : [%s]", osPath.c_str() );
163
164 HANDLE changeHandle = ::FindFirstChangeNotificationW(
165 osPath.utf16(), // directory to watch
166 FALSE, // do not watch subtree
167 FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_ATTRIBUTES); // watch file write changes
168
169 if (changeHandle == INVALID_HANDLE_VALUE || changeHandle == NULL)
170 {
171 Con::errorf("[Win32FileSystemChangeNotifier::internalAddNotification] : failed on [%s] [%d]", osPath.c_str(), GetLastError());
172
173 return false;
174 }
175
176 mDirs.push_back( dir );
177 mHandleList.push_back( changeHandle );
178
179 return true;
180}
181
182bool Win32FileSystemChangeNotifier::internalRemoveNotification( const Path &dir )
183{

Callers

nothing calls this directly

Calls 7

PathToOSFunction · 0.85
errorfFunction · 0.85
sizeMethod · 0.45
mapToMethod · 0.45
utf16Method · 0.45
c_strMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected