innertemplateaimltags.h
来自「AIML的实现」· C头文件 代码 · 共 1,701 行 · 第 1/3 页
H
1,701 行
/** * The Custom Srai class that overrides * the regular Srai AIML XML Tag */class CustomSrai : public Srai{ public: /** * Default constructor to * call Tag::addInstanceOf() and * to set the builder reference * * \param builder A reference * to the graph builder framework that * can be used to set and get information * from the AIML engine. */ CustomSrai(GraphBuilderFramework &builder) throw() : Srai(builder) { /* * Add the name of this class. Otherwise if I * didn't do this I could not call Tag::instanceOf() * this an instance of this class and get back a true. */ addInstanceOf("CustomSrai"); } /** * Returns the html string name of * the AIML XML name of this class * and any AIML XML tags that are * inside of this AIML XML Tag * * \return the htm string name of the * AIML XML Tag and any inner tags * * \throw Does not throw anything */ virtual StringPimpl getString() const throw(InternalProgrammerErrorException &) { string returnString("<srai>"); returnString += InnerTemplateListImpl::getString().c_str(); returnString += "</srai>"; return returnString.c_str(); }};/** * The Custom Star class that overrides * the regular Star AIML XML Tag */class CustomStar : public Star{ public: /** * Default constructor to * call Tag::addInstanceOf() and * to set the builder reference * * \param builder A reference * to the graph builder framework that * can be used to set and get information * from the AIML engine. */ CustomStar(GraphBuilderFramework &builder) throw() : Star(builder) { /* * Add the name of this class. Otherwise if I * didn't do this I could not call Tag::instanceOf() * this an instance of this class and get back a true. */ addInstanceOf("CustomStar"); } /** * Sets the attribute to a value. * * This is overriden to gain access to the attribute. * * \param name The name of the AIML XML attribute * * \param value The value of the AIML XML attribute * * \throw Does not throw anything */ virtual void setAttribute(const StringPimpl &name, const StringPimpl &value) throw(InternalProgrammerErrorException &) { string stringValue(value.c_str()); m_value = stringValue; } /** * Returns the html string name of * the AIML XML name of this class * and any AIML XML tags that are * inside of this AIML XML Tag * * \return the htm string name of the * AIML XML Tag and any inner tags * * \throw Does not throw anything */ virtual StringPimpl getString() const throw(InternalProgrammerErrorException &) { if(!m_value.empty()) { string returnString("<star"); returnString += " index=\"" + m_value + "\"/>"; return returnString.c_str(); } else { string returnString("<star/>"); return returnString.c_str(); } } private: /** * The value of the attribute */ string m_value;};/** * The Custom System class that overrides * the regular System AIML XML Tag */class CustomSystem : public System{ public: /** * Default constructor to * call Tag::addInstanceOf() */ CustomSystem() throw() { /* * Add the name of this class. Otherwise if I * didn't do this I could not call Tag::instanceOf() * this an instance of this class and get back a true. */ addInstanceOf("CustomSystem"); } /** * Returns the html string name of * the AIML XML name of this class * and any AIML XML tags that are * inside of this AIML XML Tag * * \return the htm string name of the * AIML XML Tag and any inner tags * * \throw Does not throw anything */ virtual StringPimpl getString() const throw(InternalProgrammerErrorException &) { string returnString("<system>"); returnString += InnerTemplateListImpl::getString().c_str(); returnString += "</system>"; return returnString.c_str(); }};/** * The Custom TemplateSideThat class that overrides * the regular TemplateSideThat AIML XML Tag */class CustomTemplateSideThat : public TemplateSideThat{ public: /** * Default constructor to * call Tag::addInstanceOf() and * to set the builder reference * * \param builder A reference * to the graph builder framework that * can be used to set and get information * from the AIML engine. */ CustomTemplateSideThat(GraphBuilderFramework &builder) throw() : TemplateSideThat(builder) { /* * Add the name of this class. Otherwise if I * didn't do this I could not call Tag::instanceOf() * this an instance of this class and get back a true. */ addInstanceOf("CustomTemplateSideThat"); } /** * Sets the attribute to a value. * * This is overriden to gain access to the attribute. * * \param name The name of the AIML XML attribute * * \param value The value of the AIML XML attribute * * \throw Does not throw anything */ virtual void setAttribute(const StringPimpl &name, const StringPimpl &value) throw(InternalProgrammerErrorException &) { string stringValue(value.c_str()); m_value = stringValue; } /** * Returns the html string name of * the AIML XML name of this class * and any AIML XML tags that are * inside of this AIML XML Tag * * \return the htm string name of the * AIML XML Tag and any inner tags * * \throw Does not throw anything */ virtual StringPimpl getString() const throw(InternalProgrammerErrorException &) { if(!m_value.empty()) { string returnString("<that"); returnString += " index=\"" + m_value + "\"/>"; return returnString.c_str(); } else { string returnString("<that/>"); return returnString.c_str(); } } private: /** * The value of the attribute */ string m_value;};/** * The Custom ThatStar class that overrides * the regular ThatStar AIML XML Tag */class CustomThatStar : public ThatStar{ public: /** * Default constructor to * call Tag::addInstanceOf() and * to set the builder reference * * \param builder A reference * to the graph builder framework that * can be used to set and get information * from the AIML engine. */ CustomThatStar(GraphBuilderFramework &builder) throw() : ThatStar(builder) { /* * Add the name of this class. Otherwise if I * didn't do this I could not call Tag::instanceOf() * this an instance of this class and get back a true. */ addInstanceOf("CustomThatStar"); } /** * Sets the attribute to a value. * * This is overriden to gain access to the attribute. * * \param name The name of the AIML XML attribute * * \param value The value of the AIML XML attribute * * \throw Does not throw anything */ virtual void setAttribute(const StringPimpl &name, const StringPimpl &value) throw(InternalProgrammerErrorException &) { string stringValue(value.c_str()); m_value = stringValue; } /** * Returns the html string name of * the AIML XML name of this class * and any AIML XML tags that are * inside of this AIML XML Tag * * \return the htm string name of the * AIML XML Tag and any inner tags * * \throw Does not throw anything */ virtual StringPimpl getString() const throw(InternalProgrammerErrorException &) { if(!m_value.empty()) { string returnString("<thatstar"); returnString += " index=\"" + m_value + "\"/>"; return returnString.c_str(); } else { string returnString("<thatstar/>"); return returnString.c_str(); } } private: /** * The value of the attribute */ string m_value;};/** * The Custom Think class that overrides * the regular Think AIML XML Tag */class CustomThink : public Think{ public: /** * Default constructor to * call Tag::addInstanceOf() */ CustomThink() throw() { /* * Add the name of this class. Otherwise if I * didn't do this I could not call Tag::instanceOf() * this an instance of this class and get back a true. */ addInstanceOf("CustomThink"); } /** * Returns the html string name of * the AIML XML name of this class * and any AIML XML tags that are * inside of this AIML XML Tag * * \return the htm string name of the * AIML XML Tag and any inner tags * * \throw Does not throw anything */ virtual StringPimpl getString() const throw(InternalProgrammerErrorException &) { string returnString("<think>"); returnString += InnerTemplateListImpl::getString().c_str(); returnString += "</think>"; return returnString.c_str(); }};/** * The Custom TopicStar class that overrides * the regular TopicStar AIML XML Tag */class CustomTopicStar : public TopicStar{ public: /** * Default constructor to * call Tag::addInstanceOf() and * to set the builder reference * * \param builder A reference * to the graph builder framework that * can be used to set and get information * from the AIML engine. */ CustomTopicStar(GraphBuilderFramework &builder) throw() : TopicStar(builder) { /* * Add the name of this class. Otherwise if I * didn't do this I could not call Tag::instanceOf() * this an instance of this class and get back a true. */ addInstanceOf("CustomTopicStar"); } /** * Sets the attribute to a value. * * This is overriden to gain access to the attribute. * * \param name The name of the AIML XML attribute * * \param value The value of the AIML XML attribute * * \throw Does not throw anything */ virtual void setAttribute(const StringPimpl &name, const StringPimpl &value) throw(InternalProgrammerErrorException &) { string stringValue(value.c_str()); m_value = stringValue; } /** * Returns the html string name of * the AIML XML name of this class * and any AIML XML tags that are * inside of this AIML XML Tag * * \return the htm string name of the * AIML XML Tag and any inner tags * * \throw Does not throw anything */ virtual StringPimpl getString() const throw(InternalProgrammerErrorException &) { if(!m_value.empty()) { string returnString("<topicstar"); returnString += " index=\"" + m_value + "\"/>"; return returnString.c_str(); } else { string returnString("<topicstar/>"); return returnString.c_str(); } } private: /** * The value of the attribute */ string m_value;};/** * The Custom upperCase class that overrides * the regular UpperCase AIML XML Tag */class CustomUpperCase : public UpperCase{ public: /** * Default constructor to * call Tag::addInstanceOf() */ CustomUpperCase() throw() { /* * Add the name of this class. Otherwise if I * didn't do this I could not call Tag::instanceOf() * this an instance of this class and get back a true. */ addInstanceOf("CustomUpperCase"); } /** * Returns the html string name of * the AIML XML name of this class * and any AIML XML tags that are * inside of this AIML XML Tag * * \return the htm string name of the * AIML XML Tag and any inner tags * * \throw Does not throw anything */ virtual StringPimpl getString() const throw(InternalProgrammerErrorException &) { string returnString("<uppercase>"); returnString += InnerTemplateListImpl::getString().c_str(); returnString += "</uppercase>"; return returnString.c_str(); }};/** * The custom version class that overrides * the regular Version AIML XML Tag */class CustomVersion : public Version{ public: /** * Default constructor to * call Tag::addInstanceOf() and * to set the builder reference * * \param builder A reference * to the graph builder framework that * can be used to set and get information * from the AIML engine. */ CustomVersion(GraphBuilderFramework &builder) throw() : Version(builder) { /* * Add the name of this class. Otherwise if I * didn't do this I could not call Tag::instanceOf() * this an instance of this class and get back a true. */ addInstanceOf("CustomVersion"); } /** * Returns the html string name of * the AIML XML name of this class * and any AIML XML tags that are * inside of this AIML XML Tag * * \return the htm string name of the * AIML XML Tag and any inner tags * * \throw Does not throw anything */ virtual StringPimpl getString() const throw(InternalProgrammerErrorException &) { string returnString("<version/>"); return returnString.c_str(); }};} //end of impl namespace } //end of customTag namespace #ifdef _WIN32# pragma warning ( pop )#endif#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?