Added ScriptResult class change in order to avoid managing string memory

created via strdup(). Script output and id (strings) are now C++ std::string.
This commit is contained in:
batrick 2008-07-07 17:37:08 +00:00
parent f9e6d7d01a
commit 13452505a5
6 changed files with 53 additions and 36 deletions

View file

@ -13,12 +13,19 @@ extern "C" {
#include <string.h>
#include <iostream>
struct script_scan_result {
char* id;
char* output;
class ScriptResult
{
private:
std::string output;
std::string id;
public:
void set_output (const char *);
std::string get_output (void);
void set_id (const char *);
std::string get_id (void);
};
typedef std::vector<struct script_scan_result> ScriptResults;
typedef std::vector<ScriptResult> ScriptResults;
class Target;
int script_scan(std::vector<Target *> &targets);