namespace filesystem {
File::File(NodePtr node, const File::PermissionList &parentPermissions,
- const std::string original_location) :
+ const std::string& original_location) :
m_node(node),
m_parentPerms(parentPermissions)
{
File(NodePtr node,
const PermissionList &parentPermissions,
- const std::string original_location = std::string());
+ const std::string& original_location = std::string());
virtual ~File();
NodePtr getNode() const;
}
}
- if (!S_ISDIR(info.st_mode) & !S_ISREG(info.st_mode) && !S_ISLNK(info.st_mode)) {
+ if ((!S_ISDIR(info.st_mode)) & (!S_ISREG(info.st_mode)) && !S_ISLNK(info.st_mode)) {
LoggerE("throw IOException for file:[%s]", path->getFullPath().c_str());
return PlatformResult(ErrorCode::IO_ERR, "Platform node is of unsupported type.");
}
LoggerE("throw IOException");
return PlatformResult(ErrorCode::IO_ERR, "Node does not exist or access denied.");
}
- int err = 0;
struct dirent entry = {0};
struct dirent* result = nullptr;
PlatformResult platform_result(ErrorCode::NO_ERROR);
- while ((0 == (err = readdir_r(dir, &entry, &result))) && result) {
+ while ((0 == (readdir_r(dir, &entry, &result))) && result) {
if (!strcmp(entry.d_name, ".") || !strncmp(entry.d_name, "..", 2)) {
continue;
}
PlatformResult UnZip::updateCallbackWithArchiveStatistics(ExtractAllProgressCallback* callback,
unz_global_info& out_global_info,
- const std::string optional_filter)
+ const std::string& optional_filter)
{
LoggerD("Enter");
int err = unzGetGlobalInfo(m_unzip, &out_global_info);
PlatformResult updateCallbackWithArchiveStatistics(ExtractAllProgressCallback* callback,
unz_global_info& out_global_info,
- const std::string optional_filter = std::string());
+ const std::string& optional_filter = std::string());
std::string m_zipfile_name;
unzFile m_unzip;
}
m_delete_output_file = true;
- int read_size = 0;
bool marked_as_finished = false;
LoggerD("Started extracting: [%s] uncompressed size: %d - %s", m_filename_inzip,
return PlatformResult(ErrorCode::OPERATION_CANCELED_ERR);
}
- read_size = unzReadCurrentFile(m_owner.m_unzip, m_buffer, buffer_size);
+ int read_size = unzReadCurrentFile(m_owner.m_unzip, m_buffer, buffer_size);
if (read_size < 0) {
LoggerE("unzReadCurrentFile failed with error code:%d for file:%s", read_size,
m_filename_inzip);