-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added an option to filter files based on size
- Loading branch information
1 parent
ab37ddd
commit e9c07b1
Showing
10 changed files
with
146 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// ------------------------------------ // | ||
#include "FileFilter.h" | ||
|
||
using namespace pcktool; | ||
// ------------------------------------ // | ||
bool FileFilter::Include(const PckFile::ContainedFile& file) | ||
{ | ||
if(file.Size < MinSizeLimit) | ||
return false; | ||
|
||
if(file.Size > MaxSizeLimit) | ||
return false; | ||
|
||
// Wasn't excluded | ||
return true; | ||
} | ||
// ------------------------------------ // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include "Define.h" | ||
|
||
#include "pck/PckFile.h" | ||
|
||
namespace pcktool { | ||
|
||
//! \brief An include / exclude filter for files | ||
class FileFilter { | ||
public: | ||
//! \returns true if filter doesn't exclude a file | ||
bool Include(const PckFile::ContainedFile& file); | ||
|
||
void SetSizeMinLimit(uint64_t size) | ||
{ | ||
MinSizeLimit = size; | ||
} | ||
|
||
void SetSizeMaxLimit(uint64_t size) | ||
{ | ||
MaxSizeLimit = size; | ||
} | ||
|
||
private: | ||
//! File is excluded if it is under this size | ||
uint64_t MinSizeLimit = 0; | ||
|
||
//! File is excluded if it is over this size | ||
uint64_t MaxSizeLimit = std::numeric_limits<uint64_t>::max(); | ||
}; | ||
|
||
} // namespace pcktool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters