Skip to content
Snippets Groups Projects
Commit 60926a66 authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

modify enable_plugin usage

Change-Id: I0d41bd1a8e55371748d36a1b5c3654ec03f6fd5b
parent 8d40c627
No related branches found
No related tags found
No related merge requests found
......@@ -348,12 +348,13 @@ static ArchivePtr createArchiveDiskWriter() {
archive_write_free(a);
}};
}
#endif
//==========================
std::vector<std::string> listArchiveContent(const std::string &archivePath)
{
std::vector<std::string> fileNames;
#ifdef ENABLE_PLUGIN
ArchivePtr archiveReader = createArchiveReader();
struct archive_entry* entry;
int r;
......@@ -371,12 +372,13 @@ std::vector<std::string> listArchiveContent(const std::string &archivePath)
std::string fileEntry = archive_entry_pathname(entry) ? archive_entry_pathname(entry) : "Undefined";
fileNames.push_back(fileEntry);
}
#endif
return fileNames;
}
void uncompressArchive(const std::string &archivePath, const std::string &dir, const FileMatchPair& f)
{
#ifdef ENABLE_PLUGIN
int r;
ArchivePtr archiveReader = createArchiveReader();
......@@ -452,11 +454,14 @@ void uncompressArchive(const std::string &archivePath, const std::string &dir, c
}
}
}
#endif
}
std::vector<uint8_t> readFileFromArchive(const std::string &archivePath,
const std::string &fileRelativePathName)
{
std::vector<uint8_t> fileContent;
#ifdef ENABLE_PLUGIN
long r;
ArchivePtr archiveReader = createArchiveReader();
struct archive_entry* entry;
......@@ -489,7 +494,6 @@ std::vector<uint8_t> readFileFromArchive(const std::string &archivePath,
if(fileEntry == fileRelativePathName){
// Copying the data content
DataBlock db;
std::vector<uint8_t> fileContent;
while(true) {
r = readDataBlock(archiveReader,db);
......@@ -513,7 +517,8 @@ std::vector<uint8_t> readFileFromArchive(const std::string &archivePath,
}
}
throw std::runtime_error("File " + fileRelativePathName + " not found in the archive");
#endif
return fileContent;
}
#endif //ENABLE_PLUGIN
}} // namespace jami::archiver
......@@ -88,7 +88,6 @@ std::vector<uint8_t> decompressGzip(const std::string& path);
*/
gzFile openGzip(const std::string& path, const char *mode);
#ifdef ENABLE_PLUGIN
/**
* @brief listArchiveContent
* @param archivePath
......@@ -120,7 +119,6 @@ void uncompressArchive(const std::string& path, const std::string &dir, const Fi
*/
std::vector<uint8_t> readFileFromArchive(const std::string &path,
const std::string &fileRelativePathName);
#endif //ENABLE_PLUGIN
}
} // namespace jami
......@@ -265,6 +265,7 @@ int JamiPluginManager::uninstallPlugin(const std::string &rootPath)
bool JamiPluginManager::loadPlugin(const std::string &rootPath)
{
#ifdef ENABLE_PLUGIN
try
{
bool status = pm_.load(getPluginDetails(rootPath).at("soPath"));
......@@ -279,10 +280,13 @@ bool JamiPluginManager::loadPlugin(const std::string &rootPath)
JAMI_ERR() << e.what();
return false;
}
#endif
return false;
}
bool JamiPluginManager::unloadPlugin(const std::string &rootPath)
{
#ifdef ENABLE_PLUGIN
try
{
bool status = pm_.unload(getPluginDetails(rootPath).at("soPath"));
......@@ -297,6 +301,8 @@ bool JamiPluginManager::unloadPlugin(const std::string &rootPath)
JAMI_ERR() << e.what();
return false;
}
#endif
return false;
}
void JamiPluginManager::togglePlugin(const std::string &rootPath, bool toggle)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment