Libraries say whether a search should be performed
This commit is contained in:
parent
72937cf6f2
commit
1a495149b2
@ -54,6 +54,7 @@ std::vector< RenameLibrary > getLibraries(const std::vector<std::pair<std::strin
|
|||||||
}
|
}
|
||||||
rl.getName = ( const std::string(*)() ) dlsym( libhndl, "getName" );
|
rl.getName = ( const std::string(*)() ) dlsym( libhndl, "getName" );
|
||||||
rl.canRenameMultipleFiles = ( const bool(*)() ) dlsym( libhndl, "canRenameMultipleFiles" );
|
rl.canRenameMultipleFiles = ( const bool(*)() ) dlsym( libhndl, "canRenameMultipleFiles" );
|
||||||
|
rl.shouldPerformSearch = ( const bool(*)() ) dlsym( libhndl, "shouldPerformSearch" );
|
||||||
rl.config = library.second;
|
rl.config = library.second;
|
||||||
result.push_back( rl );
|
result.push_back( rl );
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ std::vector< std::pair<string, string> > getCustomKeyOptions(const string &key);
|
|||||||
const string getCustomKeyDefault(const string &key);
|
const string getCustomKeyDefault(const string &key);
|
||||||
const string getName();
|
const string getName();
|
||||||
const bool canRenameMultipleFiles();
|
const bool canRenameMultipleFiles();
|
||||||
|
const bool shouldPerformSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TV_RENAME_HPP
|
#endif // TV_RENAME_HPP
|
||||||
|
4
main.cpp
4
main.cpp
@ -85,6 +85,10 @@ std::string getLibrariesJson() {
|
|||||||
result << " \"multiple_files\": "
|
result << " \"multiple_files\": "
|
||||||
<< ( library.first->canRenameMultipleFiles() ? "true"
|
<< ( library.first->canRenameMultipleFiles() ? "true"
|
||||||
: "false" )
|
: "false" )
|
||||||
|
<< ",\n";
|
||||||
|
result << " \"should_search\": "
|
||||||
|
<< ( library.first->shouldPerformSearch() ? "true"
|
||||||
|
: "false" )
|
||||||
<< "\n },\n";
|
<< "\n },\n";
|
||||||
}
|
}
|
||||||
result.seekp( -2, std::ios_base::end );
|
result.seekp( -2, std::ios_base::end );
|
||||||
|
@ -14,6 +14,7 @@ struct RenameLibrary {
|
|||||||
const std::string ( *getCustomKeyDefault )(const std::string &);
|
const std::string ( *getCustomKeyDefault )(const std::string &);
|
||||||
const std::string ( *getName )();
|
const std::string ( *getName )();
|
||||||
const bool ( *canRenameMultipleFiles )();
|
const bool ( *canRenameMultipleFiles )();
|
||||||
|
const bool ( *shouldPerformSearch )();
|
||||||
void *libhndl;
|
void *libhndl;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string config;
|
std::string config;
|
||||||
|
@ -68,3 +68,7 @@ const string getName() {
|
|||||||
const bool canRenameMultipleFiles() {
|
const bool canRenameMultipleFiles() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool shouldPerformSearch() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -527,3 +527,7 @@ const string getName() {
|
|||||||
const bool canRenameMultipleFiles() {
|
const bool canRenameMultipleFiles() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool shouldPerformSearch() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@ -652,3 +652,7 @@ const string getName() {
|
|||||||
const bool canRenameMultipleFiles() {
|
const bool canRenameMultipleFiles() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool shouldPerformSearch() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user