#ifndef CHROME_BROWSER_PROFILE_RESETTER_JTL_INTERPRETER_H_
#define CHROME_BROWSER_PROFILE_RESETTER_JTL_INTERPRETER_H_
#include <string>
#include "base/basictypes.h"
#include "base/values.h"
class JtlInterpreter {
public:
enum Result {
OK,
PARSE_ERROR,
RUNTIME_ERROR,
RESULT_MAX,
};
JtlInterpreter(const std::string& hasher_seed,
const std::string& program,
const base::DictionaryValue* input);
~JtlInterpreter();
void Execute();
Result result() const { return result_; }
const base::DictionaryValue* working_memory() const {
return working_memory_.get();
}
bool GetOutputBoolean(const std::string& unhashed_key, bool* output) const;
bool GetOutputString(const std::string& unhashed_key,
std::string* output) const;
int CalculateProgramChecksum() const;
private:
std::string hasher_seed_;
std::string program_;
const base::DictionaryValue* input_;
scoped_ptr<base::DictionaryValue> working_memory_;
Result result_;
DISALLOW_COPY_AND_ASSIGN(JtlInterpreter);
};
#endif