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

Method removeNotification

Engine/source/core/volume.cpp:105–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105bool FileSystemChangeNotifier::removeNotification( const Path &path, ChangeDelegate callback )
106{
107 if (path.isEmpty())
108 return false;
109
110 // strip the filename and extension - we notify on dirs
111 Path dir(cleanPath(path));
112 if (dir.isEmpty())
113 return false;
114
115 dir.setFileName( String() );
116 dir.setExtension( String () );
117
118 DirMap::Iterator itr = mDirMap.find( dir );
119
120 if ( itr == mDirMap.end() )
121 return false;
122
123 FileInfoList &fileList = itr->value;
124
125 // look for the file and return if we find it
126 for ( U32 i = 0; i < fileList.getSize(); i++ )
127 {
128 FileInfo &fInfo = fileList[i];
129 if ( fInfo.filePath == path )
130 {
131 fInfo.signal.remove(callback);
132 if (fInfo.signal.isEmpty())
133 fileList.erase( i );
134 break;
135 }
136 }
137
138 // IF we removed the last file
139 // THEN get rid of the dir from our map and notify inherited classes
140 if ( fileList.getSize() == 0 )
141 {
142 mDirMap.erase( dir );
143
144 return internalRemoveNotification( dir );
145 }
146
147 return true;
148}
149
150void FileSystemChangeNotifier::startNotifier()
151{

Callers 1

RemoveChangeNotificationFunction · 0.80

Calls 11

_mergeMethod · 0.80
getFileSystemMethod · 0.80
getChangeNotifierMethod · 0.80
StringClass · 0.50
isEmptyMethod · 0.45
setExtensionMethod · 0.45
findMethod · 0.45
endMethod · 0.45
getSizeMethod · 0.45
removeMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected