setprocessor.h
来自「J-Alice是一个用C++实现的Ailcebot的克隆。它可以做为一个mini」· C头文件 代码 · 共 43 行
H
43 行
/**
* SetProcessor - Used to set value of a user predicate
*
* @author Jonathan Roewen
*/
#ifndef SET_PROCESSOR_H
#define SET_PROCESSOR_H
#include "AimlProcessor.h"
#include "Memory.h"
#include "Kernel.h"
#include "Utils.h"
#include <string>
using namespace std;
class SetProcessor : public AimlProcessor
{
public:
~SetProcessor() { }
string getName() const {
return "set";
}
string getVersion() const {
return "1.0";
}
string process(Match *m, PElement e, Responder *r, const string &id) {
string property = toLower(e->getAttribute("name", m, id));
string value = "";
if (!e->hasChildren()) {
value = m->getInputStar(1);
} else {
value = Kernel::process(m, e, r, id);
}
Memory::setValue(property, id, value);
return value;
}
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?