40 const std::string s = *itr;
41 if (lastStr.find(s) != std::string::npos && s.length()) {
75 allStrings = p1.allStrings;
102 const bool isClean = (val == 0) ?
true :
false;
135 outs << std::hex <<
"\"" <<
offset <<
"\"";
138 outs << std::hex <<
"\"" <<
size <<
"\"";
140 OUT_PADDED(outs, level,
"\"charset_size\" : ");
143 std::set<BYTE> values;
145 if (freq && values.size()) {
147 OUT_PADDED(outs, level,
"\"most_freq_vals\" : ");
148 outs << std::hex <<
"\"";
163 const size_t count = itr->second;
164 const BYTE val = itr->first;
186 std::vector< std::string > allStrings;
205 if (!multiSettings)
return false;
213 OUT_PADDED(outs, level,
"\"full_area\" : {\n");
void _appendVal(BYTE val)
bool fillSettings(StatsSettings *settings)
virtual const void fieldsToJSON(std::stringstream &outs, size_t level)
AreaMultiStats(const AreaMultiStats &p1)
Base class for the statistics from analyzed buffer.
size_t getMostFrequentValues(IN const std::map< size_t, std::set< T > > &frequencies, OUT std::set< T > &values, IN OPTIONAL size_t top=0, IN OPTIONAL size_t maxDiff=0)
double calcShannonEntropy(std::map< T, size_t > &histogram, size_t totalSize)
std::string hexdumpValues(std::set< T > &values)
std::string escape_path_separators(std::string path)
Statistics from a block of data.
std::map< size_t, std::set< BYTE > > frequencies
MultiStatsSettings * settings
void finishLastStr(bool isClean)
ChunkStats(size_t _offset, size_t _size)
void fillSettings(MultiStatsSettings *_settings)
ChunkStats(const ChunkStats &p1)
std::map< BYTE, size_t > histogram
virtual const void fieldsToJSON(std::stringstream &outs, size_t level)
std::map< std::string, size_t > foundStrings
Settings defining what type of stats should be collected.
std::string hasWatchedSubstring(std::string &lastStr)
Searches a given substring among the watchedStrings. If the substring found, return the corresponding...
MultiStatsSettings(const MultiStatsSettings &p1)
std::set< std::string > watchedStrings
Base class for settings defining what type of stats should be collected.