Remove other using statements from headers

This commit is contained in:
Tim Wojtulewicz 2020-04-07 13:14:17 -07:00
parent eb010290eb
commit a525f9532e
22 changed files with 123 additions and 171 deletions

View file

@ -14,9 +14,6 @@
#include "analyzer/Tag.h"
using std::map;
using std::set;
class TableVal;
class VectorVal;
@ -75,7 +72,7 @@ public:
* a single file.
* @return a prettified MD5 hash of \a handle, truncated to *bits_per_uid* bits.
*/
string HashHandle(const string& handle) const;
std::string HashHandle(const std::string& handle) const;
/**
* Take in a unique file handle string to identify next piece of
@ -83,7 +80,7 @@ public:
* @param handle a unique string (may contain NULs) which identifies
* a single file.
*/
void SetHandle(const string& handle);
void SetHandle(const std::string& handle);
/**
* Pass in non-sequential file data.
@ -150,8 +147,8 @@ public:
* in human-readable form where the file input is coming from (e.g.
* a local file path).
*/
void DataIn(const u_char* data, uint64_t len, const string& file_id,
const string& source);
void DataIn(const u_char* data, uint64_t len, const std::string& file_id,
const std::string& source);
/**
* Signal the end of file data regardless of which direction it is being
@ -173,7 +170,7 @@ public:
* Signal the end of file data being transferred using the file identifier.
* @param file_id the file identifier/hash.
*/
void EndOfFile(const string& file_id);
void EndOfFile(const std::string& file_id);
/**
* Signal a gap in the file data stream.
@ -219,7 +216,7 @@ public:
* @param file_id the file identifier/hash.
* @return false if file identifier did not map to anything, else true.
*/
bool IgnoreFile(const string& file_id);
bool IgnoreFile(const std::string& file_id);
/**
* Set's an inactivity threshold for the file.
@ -229,22 +226,22 @@ public:
* to be considered stale, timed out, and then resource reclaimed.
* @return false if file identifier did not map to anything, else true.
*/
bool SetTimeoutInterval(const string& file_id, double interval) const;
bool SetTimeoutInterval(const std::string& file_id, double interval) const;
/**
* Enable the reassembler for a file.
*/
bool EnableReassembly(const string& file_id);
bool EnableReassembly(const std::string& file_id);
/**
* Disable the reassembler for a file.
*/
bool DisableReassembly(const string& file_id);
bool DisableReassembly(const std::string& file_id);
/**
* Set the reassembly for a file in bytes.
*/
bool SetReassemblyBuffer(const string& file_id, uint64_t max);
bool SetReassemblyBuffer(const std::string& file_id, uint64_t max);
/**
* Sets a limit on the maximum size allowed for extracting the file
@ -256,7 +253,7 @@ public:
* @return false if file identifier and analyzer did not map to anything,
* else true.
*/
bool SetExtractionLimit(const string& file_id, RecordVal* args,
bool SetExtractionLimit(const std::string& file_id, RecordVal* args,
uint64_t n) const;
/**
@ -265,7 +262,7 @@ public:
* @return the File object mapped to \a file_id, or a null pointer if no
* mapping exists.
*/
File* LookupFile(const string& file_id) const;
File* LookupFile(const std::string& file_id) const;
/**
* Queue attachment of an analzer to the file identifier. Multiple
@ -276,7 +273,7 @@ public:
* @param args a \c AnalyzerArgs value which describes a file analyzer.
* @return false if the analyzer failed to be instantiated, else true.
*/
bool AddAnalyzer(const string& file_id, const file_analysis::Tag& tag,
bool AddAnalyzer(const std::string& file_id, const file_analysis::Tag& tag,
RecordVal* args) const;
/**
@ -286,7 +283,7 @@ public:
* @param args a \c AnalyzerArgs value which describes a file analyzer.
* @return true if the analyzer is active at the time of call, else false.
*/
bool RemoveAnalyzer(const string& file_id, const file_analysis::Tag& tag,
bool RemoveAnalyzer(const std::string& file_id, const file_analysis::Tag& tag,
RecordVal* args) const;
/**
@ -294,7 +291,7 @@ public:
* @param file_id the file identifier/hash.
* @return whether the file mapped to \a file_id is being ignored.
*/
bool IsIgnored(const string& file_id);
bool IsIgnored(const std::string& file_id);
/**
* Instantiates a new file analyzer instance for the file.
@ -358,7 +355,7 @@ protected:
* exist, the activity time is refreshed along with any
* connection-related fields.
*/
File* GetFile(const string& file_id, Connection* conn = 0,
File* GetFile(const std::string& file_id, Connection* conn = 0,
const analyzer::Tag& tag = analyzer::Tag::Error,
bool is_orig = false, bool update_conn = true,
const char* source_name = 0);
@ -370,14 +367,14 @@ protected:
* @param is_termination whether the Manager (and probably Bro) is in a
* terminating state. If true, then the timeout cannot be postponed.
*/
void Timeout(const string& file_id, bool is_terminating = ::terminating);
void Timeout(const std::string& file_id, bool is_terminating = ::terminating);
/**
* Immediately remove file_analysis::File object associated with \a file_id.
* @param file_id the file identifier/hash.
* @return false if file id string did not map to anything, else true.
*/
bool RemoveFile(const string& file_id);
bool RemoveFile(const std::string& file_id);
/**
* Sets #current_file_id to a hash of a unique file handle string based on
@ -403,20 +400,20 @@ protected:
static bool IsDisabled(const analyzer::Tag& tag);
private:
typedef set<Tag> TagSet;
typedef map<string, TagSet*> MIMEMap;
typedef std::set<Tag> TagSet;
typedef std::map<std::string, TagSet*> MIMEMap;
TagSet* LookupMIMEType(const string& mtype, bool add_if_not_found);
TagSet* LookupMIMEType(const std::string& mtype, bool add_if_not_found);
std::map<string, File*> id_map; /**< Map file ID to file_analysis::File records. */
std::set<string> ignored; /**< Ignored files. Will be finally removed on EOF. */
string current_file_id; /**< Hash of what get_file_handle event sets. */
std::map<std::string, File*> id_map; /**< Map file ID to file_analysis::File records. */
std::set<std::string> ignored; /**< Ignored files. Will be finally removed on EOF. */
std::string current_file_id; /**< Hash of what get_file_handle event sets. */
RuleFileMagicState* magic_state; /**< File magic signature match state. */
MIMEMap mime_types;/**< Mapping of MIME types to analyzers. */
static TableVal* disabled; /**< Table of disabled analyzers. */
static TableType* tag_set_type; /**< Type for set[tag]. */
static string salt; /**< A salt added to file handles before hashing. */
static std::string salt; /**< A salt added to file handles before hashing. */
size_t cumulative_files;
size_t max_files;