|
@@ -147,30 +147,30 @@ bool BaseSet<T, Tnum_files, Tsearch_in_t
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
template <class Tbase_set>
|
|
|
bool BaseMedia<Tbase_set>::AddFile(const char *filename, size_t basepath_length, const char *tar_filename)
|
|
|
bool BaseMedia<Tbase_set>::AddFile(const std::string &filename, size_t basepath_length, const std::string &tar_filename)
|
|
|
{
|
|
|
bool ret = false;
|
|
|
DEBUG(grf, 1, "Checking %s for base " SET_TYPE " set", filename);
|
|
|
DEBUG(grf, 1, "Checking %s for base " SET_TYPE " set", filename.c_str());
|
|
|
|
|
|
Tbase_set *set = new Tbase_set();
|
|
|
IniFile *ini = new IniFile();
|
|
|
std::string path{ filename + basepath_length };
|
|
|
std::string path{ filename, basepath_length };
|
|
|
ini->LoadFromDisk(path, BASESET_DIR);
|
|
|
|
|
|
auto psep = path.rfind(PATHSEPCHAR);
|
|
|
if (psep != std::string::npos) {
|
|
|
path.erase(psep + 1);
|
|
|
} else {
|
|
|
path.clear();
|
|
|
}
|
|
|
|
|
|
if (set->FillSetDetails(ini, path.c_str(), filename)) {
|
|
|
if (set->FillSetDetails(ini, path.c_str(), filename.c_str())) {
|
|
|
Tbase_set *duplicate = nullptr;
|
|
|
for (Tbase_set *c = BaseMedia<Tbase_set>::available_sets; c != nullptr; c = c->next) {
|
|
|
if (c->name == set->name || c->shortname == set->shortname) {
|
|
|
duplicate = c;
|
|
|
break;
|
|
|
}
|
|
@@ -374,13 +374,13 @@ template <class Tbase_set>
|
|
|
* @param repl_type the type of the BaseMedia to instantiate
|
|
|
* @param set_type the type of the BaseSet to instantiate
|
|
|
*/
|
|
|
#define INSTANTIATE_BASE_MEDIA_METHODS(repl_type, set_type) \
|
|
|
template std::string repl_type::ini_set; \
|
|
|
template const char *repl_type::GetExtension(); \
|
|
|
template bool repl_type::AddFile(const char *filename, size_t pathlength, const char *tar_filename); \
|
|
|
template bool repl_type::AddFile(const std::string &filename, size_t pathlength, const std::string &tar_filename); \
|
|
|
template bool repl_type::HasSet(const struct ContentInfo *ci, bool md5sum); \
|
|
|
template bool repl_type::SetSet(const std::string &name); \
|
|
|
template char *repl_type::GetSetsList(char *p, const char *last); \
|
|
|
template int repl_type::GetNumSets(); \
|
|
|
template int repl_type::GetIndexOfUsedSet(); \
|
|
|
template const set_type *repl_type::GetSet(int index); \
|