MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / internalNotifyDirChanged

Method internalNotifyDirChanged

Engine/source/core/volume.cpp:200–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200void FileSystemChangeNotifier::internalNotifyDirChanged( const Path &dir )
201{
202 DirMap::Iterator itr = mDirMap.find( dir );
203 if ( itr == mDirMap.end() )
204 return;
205
206 // Gather the changed file info.
207 FileInfoList changedList;
208 FileInfoList &fileList = itr->value;
209 for ( U32 i = 0; i < fileList.getSize(); i++ )
210 {
211 FileInfo &fInfo = fileList[i];
212
213 FileNode::Attributes attr;
214 bool success = GetFileAttributes(fInfo.filePath, &attr);
215
216 // Ignore the file if we couldn't get the attributes (it must have
217 // been deleted) or the last modification time isn't newer.
218 if ( !success || attr.mtime <= fInfo.savedLastModTime )
219 continue;
220
221 // Store the new mod time.
222 fInfo.savedLastModTime = attr.mtime;
223
224 // We're taking a copy of the FileInfo struct here so that the
225 // callback can safely remove the notification without crashing.
226 changedList.pushBack( fInfo );
227 }
228
229 // Now signal all the changed files.
230 for ( U32 i = 0; i < changedList.getSize(); i++ )
231 {
232 FileInfo &fInfo = changedList[i];
233
234 Con::warnf( " : file changed [%s]", fInfo.filePath.getFullPath().c_str() );
235 fInfo.signal.trigger( fInfo.filePath );
236 }
237}
238
239//-----------------------------------------------------------------------------
240

Callers

nothing calls this directly

Calls 8

GetFileAttributesFunction · 0.85
warnfFunction · 0.50
findMethod · 0.45
endMethod · 0.45
getSizeMethod · 0.45
pushBackMethod · 0.45
c_strMethod · 0.45
triggerMethod · 0.45

Tested by

no test coverage detected