(svn r24487) -Codechange [FS#5236]: make several DoesContentExist return the path instead of a boolean (LordAro)
This commit is contained in:
@@ -271,4 +271,12 @@ bool ScriptScanner::HasScript(const ContentInfo *ci, bool md5sum)
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *ScriptScanner::FindMainScript(const ContentInfo *ci, bool md5sum)
|
||||
{
|
||||
for (ScriptInfoList::iterator it = this->info_list.begin(); it != this->info_list.end(); it++) {
|
||||
if (IsSameScript(ci, md5sum, (*it).second, this->GetDirectory())) return (*it).second->GetMainScript();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
@@ -69,6 +69,14 @@ public:
|
||||
*/
|
||||
bool HasScript(const struct ContentInfo *ci, bool md5sum);
|
||||
|
||||
/**
|
||||
* Find a script of a #ContentInfo
|
||||
* @param ci The information to compare to.
|
||||
* @param md5sum Whether to check the MD5 checksum.
|
||||
* @return A filename of a file of the content, else \c NULL.
|
||||
*/
|
||||
const char *FindMainScript(const ContentInfo *ci, bool md5sum);
|
||||
|
||||
/* virtual */ bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename);
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user