00001 #ifndef CUSTOMHTML_INNERTEMPLATEAIMLTAGS_H
00002 #define CUSTOMHTML_INNERTEMPLATEAIMLTAGS_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <rebecca/framework/Gender.h>
00030 #include <rebecca/framework/Bot.h>
00031 #include <rebecca/framework/Condition.h>
00032 #include <rebecca/framework/Date.h>
00033 #include <rebecca/framework/Formal.h>
00034 #include <rebecca/framework/Gender.h>
00035 #include <rebecca/framework/Get.h>
00036 #include <rebecca/framework/Gossip.h>
00037 #include <rebecca/framework/Id.h>
00038 #include <rebecca/framework/Input.h>
00039 #include <rebecca/framework/Li.h>
00040 #include <rebecca/framework/LowerCase.h>
00041 #include <rebecca/framework/Pattern.h>
00042 #include <rebecca/framework/Person.h>
00043 #include <rebecca/framework/Person2.h>
00044 #include <rebecca/framework/Random.h>
00045 #include <rebecca/framework/Sentence.h>
00046 #include <rebecca/framework/Set.h>
00047 #include <rebecca/framework/Size.h>
00048 #include <rebecca/framework/Srai.h>
00049 #include <rebecca/framework/Star.h>
00050 #include <rebecca/framework/System.h>
00051 #include <rebecca/framework/TemplateSideThat.h>
00052 #include <rebecca/framework/ThatStar.h>
00053 #include <rebecca/framework/Think.h>
00054 #include <rebecca/framework/TopicStar.h>
00055 #include <rebecca/framework/UpperCase.h>
00056 #include <rebecca/framework/NonImplemented.h>
00057 #include <rebecca/framework/Version.h>
00058 #include <rebecca/framework/GraphBuilderFramework.h>
00059 #include <string>
00060
00061
00062
00063
00064 #ifdef _WIN32
00065 # pragma warning ( push )
00066 # pragma warning( disable : 4290 )
00067 #endif
00068
00069 namespace customTag
00070 {
00071 namespace impl
00072 {
00073
00074 using namespace rebecca::framework;
00075 using namespace std;
00076 using namespace boost;
00077
00082 class CustomGender : public Gender
00083 {
00084 public:
00085
00096 CustomGender(GraphBuilderFramework &builder) throw()
00097 : Gender(builder)
00098 {
00099
00100
00101
00102
00103
00104 addInstanceOf("CustomGender");
00105 }
00106
00118 virtual StringPimpl getString() const
00119 throw(InternalProgrammerErrorException &)
00120 {
00121 string returnString("<gender>");
00122 StringPimpl s = InnerTemplateListImpl::getString();
00123 returnString += s.c_str();
00124 returnString += "</gender>";
00125 return returnString.c_str();
00126 }
00127 };
00128
00133 class CustomBot : public Bot
00134 {
00135 public:
00136
00147 CustomBot(GraphBuilderFramework &builder) throw()
00148 : Bot(builder)
00149 {
00150
00151
00152
00153
00154
00155 addInstanceOf("CustomBot");
00156 }
00157
00169 virtual StringPimpl getString() const
00170 throw(InternalProgrammerErrorException &)
00171 {
00172 string returnString("<bot name=\"" + m_value + "\"/>");
00173 return returnString.c_str();
00174 }
00175
00187 virtual void setAttribute(const StringPimpl &name, const StringPimpl &value)
00188 throw(InternalProgrammerErrorException &)
00189 {
00190 m_value = value.c_str();
00191 }
00192
00193 private:
00194
00198 string m_value;
00199 };
00200
00205 class CustomCondition : public Condition
00206 {
00207 public:
00208
00219 CustomCondition(GraphBuilderFramework &builder) throw()
00220 : Condition(builder)
00221 {
00222
00223
00224
00225
00226
00227 addInstanceOf("CustomCondition");
00228 }
00229
00237 virtual void add(const shared_ptr<InnerTemplate> &tag)
00238 throw(InternalProgrammerErrorException &)
00239 {
00240 m_list.add(tag);
00241 }
00242
00254 virtual StringPimpl getString() const
00255 throw(InternalProgrammerErrorException &)
00256 {
00257 string returnString("<condition");
00258
00259 if(!m_name.empty())
00260 {
00261 returnString += " name=\"" + m_name + "\"";
00262 }
00263
00264 if(!m_value.empty())
00265 {
00266 returnString += " value=\"" + m_value + "\"";
00267 }
00268
00269 returnString += ">";
00270 returnString += m_list.getString().c_str();
00271 returnString += "</condition>";
00272 return returnString.c_str();
00273 }
00274
00286 virtual void setAttribute(const StringPimpl &name, const StringPimpl &value)
00287 throw(InternalProgrammerErrorException &)
00288 {
00289 string stringName(name.c_str());
00290 string stringValue(value.c_str());
00291
00292 if(stringName == "name")
00293 {
00294 m_name = stringValue;
00295 }
00296 else if(stringName == "value")
00297 {
00298 m_value = stringValue;
00299 }
00300 }
00301
00302 private:
00303
00309 InnerTemplateListImpl m_list;
00310
00314 string m_name;
00315
00319 string m_value;
00320 };
00321
00326 class CustomLi : public Li
00327 {
00328 public:
00329
00334 CustomLi() throw()
00335 {
00336
00337
00338
00339
00340
00341 addInstanceOf("CustomLi");
00342 }
00343
00355 virtual void setAttribute(const StringPimpl &name, const StringPimpl &value)
00356 throw(InternalProgrammerErrorException &)
00357 {
00358 string stringName(name.c_str());
00359 string stringValue(value.c_str());
00360
00361 if(stringName == "name")
00362 {
00363 m_name = stringValue;
00364 }
00365 else if(stringName == "value")
00366 {
00367 m_value = stringValue;
00368 }
00369 }
00370
00382 virtual StringPimpl getString() const
00383 throw(InternalProgrammerErrorException &)
00384 {
00385 string returnString("<li");
00386
00387 if(!m_name.empty())
00388 {
00389 returnString += " name=\"" + m_name + "\"";
00390 }
00391
00392 if(!m_value.empty())
00393 {
00394 returnString += " value=\"" + m_value + "\"";
00395 }
00396
00397 returnString += ">";
00398 returnString += InnerTemplateListImpl::getString().c_str();
00399 returnString += "</li>";
00400 return returnString.c_str();
00401 }
00402
00403 private:
00404
00409 string m_name;
00413 string m_value;
00414
00415 };
00416
00421 class CustomDate : public Date
00422 {
00423 public:
00424
00429 CustomDate() throw()
00430 {
00431
00432
00433
00434
00435
00436 addInstanceOf("CustomDate");
00437 }
00438
00450 virtual StringPimpl getString() const
00451 throw(InternalProgrammerErrorException &)
00452 {
00453 string returnString("<date/>");
00454 return returnString.c_str();
00455 }
00456 };
00457
00462 class CustomFormal : public Formal
00463 {
00464 public:
00465
00470 CustomFormal() throw()
00471 {
00472
00473
00474
00475
00476
00477 addInstanceOf("CustomFormal");
00478 }
00479
00491 virtual StringPimpl getString() const
00492 throw(InternalProgrammerErrorException &)
00493 {
00494 string returnString("<formal>");
00495 returnString += InnerTemplateListImpl::getString().c_str();
00496 returnString += "</formal>";
00497 return returnString.c_str();
00498 }
00499 };
00500
00505 class CustomGossip : public Gossip
00506 {
00507 public:
00508
00519 CustomGossip(GraphBuilderFramework &builder) throw()
00520 : Gossip(builder)
00521 {
00522
00523
00524
00525
00526
00527 addInstanceOf("CustomGossip");
00528 }
00529
00541 virtual StringPimpl getString() const
00542 throw(InternalProgrammerErrorException &)
00543 {
00544 string returnString("<gossip>");
00545 returnString += InnerTemplateListImpl::getString().c_str();
00546 returnString += "</gossip>";
00547 return returnString.c_str();
00548 }
00549 };
00550
00555 class CustomGet : public Get
00556 {
00557 public:
00558
00569 CustomGet(GraphBuilderFramework &builder) throw()
00570 : Get(builder)
00571 {
00572
00573
00574
00575
00576
00577 addInstanceOf("CustomGet");
00578 }
00579
00591 virtual StringPimpl getString() const
00592 throw(InternalProgrammerErrorException &)
00593 {
00594 string returnString("<get name=\"" + m_value + "\"/>");
00595 return returnString.c_str();
00596 }
00597
00609 virtual void setAttribute(const StringPimpl &name, const StringPimpl &value)
00610 throw(InternalProgrammerErrorException &)
00611 {
00612 m_value = value.c_str();
00613 }
00614
00615 private:
00616
00620 string m_name;
00621
00625 string m_value;
00626 };
00627
00632 class CustomId : public Id
00633 {
00634 public:
00635
00646 CustomId(GraphBuilderFramework &builder)
00647 : Id(builder)
00648 {
00649
00650
00651
00652
00653
00654 addInstanceOf("CustomId");
00655 }
00656
00668 virtual StringPimpl getString() const
00669 throw(InternalProgrammerErrorException &)
00670 {
00671 string returnString("<id/>");
00672 return returnString.c_str();
00673 }
00674 };
00675
00680 class CustomInput : public Input
00681 {
00682 public:
00683
00694 CustomInput(GraphBuilderFramework &builder)
00695 : Input(builder)
00696 {
00697
00698
00699
00700
00701
00702 addInstanceOf("CustomInput");
00703 }
00704
00716 virtual void setAttribute(const StringPimpl &name, const StringPimpl &value)
00717 throw(InternalProgrammerErrorException &)
00718 {
00719 string stringValue(value.c_str());
00720 m_value = stringValue;
00721 }
00722
00734 virtual StringPimpl getString() const
00735 throw(InternalProgrammerErrorException &)
00736 {
00737 if(!m_value.empty())
00738 {
00739 string returnString("<input");
00740 returnString += " index=\"" + m_value + "\"/>";
00741 return returnString.c_str();
00742 }
00743 else
00744 {
00745 string returnString("<input/>");
00746 return returnString.c_str();
00747 }
00748
00749 }
00750
00751 private:
00752
00756 string m_value;
00757 };
00758
00763 class CustomLowerCase : public LowerCase
00764 {
00765 public:
00766
00771 CustomLowerCase() throw()
00772 {
00773
00774
00775
00776
00777
00778 addInstanceOf("CustomLowerCase");
00779 }
00780
00792 virtual StringPimpl getString() const
00793 throw(InternalProgrammerErrorException &)
00794 {
00795 string returnString("<lowercase>");
00796 returnString += InnerTemplateListImpl::getString().c_str();
00797 returnString += "</lowercase>";
00798 return returnString.c_str();
00799 }
00800 };
00801
00806 class CustomPerson : public Person
00807 {
00808 public:
00809
00820 CustomPerson(GraphBuilderFramework &builder) throw()
00821 : Person(builder)
00822 {
00823
00824
00825
00826
00827
00828 addInstanceOf("CustomPerson");
00829 }
00830
00842 virtual StringPimpl getString() const
00843 throw(InternalProgrammerErrorException &)
00844 {
00845 string returnString("<person>");
00846 returnString += InnerTemplateListImpl::getString().c_str();
00847 returnString += "</person>";
00848 return returnString.c_str();
00849 }
00850 };
00851
00856 class CustomPerson2 : public Person2
00857 {
00858 public:
00859
00870 CustomPerson2(GraphBuilderFramework &builder) throw()
00871 : Person2(builder)
00872 {
00873
00874
00875
00876
00877
00878 addInstanceOf("CustomPerson2");
00879 }
00880
00892 virtual StringPimpl getString() const
00893 throw(InternalProgrammerErrorException &)
00894 {
00895 string returnString("<person2>");
00896 returnString += InnerTemplateListImpl::getString().c_str();
00897 returnString += "</person2>";
00898 return returnString.c_str();
00899 }
00900 };
00901
00902
00907 class CustomRandom : public Random
00908 {
00909 public:
00910
00915 CustomRandom() throw()
00916 {
00917
00918
00919
00920
00921
00922 addInstanceOf("CustomRandom");
00923 }
00924
00932 virtual void add(const shared_ptr<InnerTemplate> &tag)
00933 throw(InternalProgrammerErrorException &)
00934 {
00935 m_list.add(tag);
00936 }
00937
00949 virtual StringPimpl getString() const
00950 throw(InternalProgrammerErrorException &)
00951 {
00952 string returnString("<random>");
00953 returnString += m_list.getString().c_str();
00954 returnString += "</random>";
00955 return returnString.c_str();
00956 }
00957
00958 private:
00959
00965 InnerTemplateListImpl m_list;
00966 };
00967
00972 class CustomSentence : public Sentence
00973 {
00974 public:
00975
00980 CustomSentence() throw()
00981 {
00982
00983
00984
00985
00986
00987 addInstanceOf("CustomSentence");
00988 }
00989
01001 virtual StringPimpl getString() const
01002 throw(InternalProgrammerErrorException &)
01003 {
01004 string returnString("<sentence>");
01005 returnString += InnerTemplateListImpl::getString().c_str();
01006 returnString += "</sentence>";
01007 return returnString.c_str();
01008 }
01009 };
01010
01015 class CustomSet : public Set
01016 {
01017 public:
01018
01029 CustomSet(GraphBuilderFramework &builder) throw()
01030 : Set(builder)
01031 {
01032
01033
01034
01035
01036
01037 addInstanceOf("CustomSet");
01038 }
01039
01051 virtual void setAttribute(const StringPimpl &name, const StringPimpl &value)
01052 throw(InternalProgrammerErrorException &)
01053 {
01054 string stringValue(value.c_str());
01055 m_value = stringValue;
01056 }
01057
01069 virtual StringPimpl getString() const
01070 throw(InternalProgrammerErrorException &)
01071 {
01072 string returnString("<set");
01073 returnString += " name=\"" + m_value + "\">";
01074 returnString += InnerTemplateListImpl::getString().c_str();
01075 returnString += "</set>";
01076 return returnString.c_str();
01077 }
01078
01079 private:
01080
01084 string m_value;
01085 };
01086
01091 class CustomSize : public Size
01092 {
01093 public:
01094
01105 CustomSize(GraphBuilderFramework &builder) throw()
01106 : Size(builder)
01107 {
01108
01109
01110
01111
01112
01113 addInstanceOf("CustomSize");
01114 }
01115
01127 virtual StringPimpl getString() const
01128 throw(InternalProgrammerErrorException &)
01129 {
01130 string returnString("<size/>");
01131 return returnString.c_str();
01132 }
01133 };
01134
01139 class CustomSrai : public Srai
01140 {
01141 public:
01142
01153 CustomSrai(GraphBuilderFramework &builder) throw()
01154 : Srai(builder)
01155 {
01156
01157
01158
01159
01160
01161 addInstanceOf("CustomSrai");
01162 }
01163
01175 virtual StringPimpl getString() const
01176 throw(InternalProgrammerErrorException &)
01177 {
01178 string returnString("<srai>");
01179 returnString += InnerTemplateListImpl::getString().c_str();
01180 returnString += "</srai>";
01181 return returnString.c_str();
01182 }
01183 };
01184
01189 class CustomStar : public Star
01190 {
01191 public:
01192
01203 CustomStar(GraphBuilderFramework &builder) throw()
01204 : Star(builder)
01205 {
01206
01207
01208
01209
01210
01211 addInstanceOf("CustomStar");
01212 }
01213
01225 virtual void setAttribute(const StringPimpl &name, const StringPimpl &value) throw(InternalProgrammerErrorException &)
01226 {
01227 string stringValue(value.c_str());
01228 m_value = stringValue;
01229 }
01230
01242 virtual StringPimpl getString() const
01243 throw(InternalProgrammerErrorException &)
01244 {
01245 if(!m_value.empty())
01246 {
01247 string returnString("<star");
01248 returnString += " index=\"" + m_value + "\"/>";
01249 return returnString.c_str();
01250 }
01251 else
01252 {
01253 string returnString("<star/>");
01254 return returnString.c_str();
01255 }
01256
01257 }
01258
01259 private:
01260
01264 string m_value;
01265 };
01266
01271 class CustomSystem : public System
01272 {
01273 public:
01274
01279 CustomSystem() throw()
01280 {
01281
01282
01283
01284
01285
01286 addInstanceOf("CustomSystem");
01287 }
01288
01300 virtual StringPimpl getString() const
01301 throw(InternalProgrammerErrorException &)
01302 {
01303 string returnString("<system>");
01304 returnString += InnerTemplateListImpl::getString().c_str();
01305 returnString += "</system>";
01306 return returnString.c_str();
01307 }
01308 };
01309
01314 class CustomTemplateSideThat : public TemplateSideThat
01315 {
01316 public:
01317
01328 CustomTemplateSideThat(GraphBuilderFramework &builder) throw()
01329 : TemplateSideThat(builder)
01330 {
01331
01332
01333
01334
01335
01336 addInstanceOf("CustomTemplateSideThat");
01337 }
01338
01350 virtual void setAttribute(const StringPimpl &name, const StringPimpl &value)
01351 throw(InternalProgrammerErrorException &)
01352 {
01353 string stringValue(value.c_str());
01354 m_value = stringValue;
01355 }
01356
01368 virtual StringPimpl getString() const
01369 throw(InternalProgrammerErrorException &)
01370 {
01371 if(!m_value.empty())
01372 {
01373 string returnString("<that");
01374 returnString += " index=\"" + m_value + "\"/>";
01375 return returnString.c_str();
01376 }
01377 else
01378 {
01379 string returnString("<that/>");
01380 return returnString.c_str();
01381 }
01382
01383 }
01384
01385 private:
01386
01390 string m_value;
01391 };
01392
01397 class CustomThatStar : public ThatStar
01398 {
01399 public:
01400
01411 CustomThatStar(GraphBuilderFramework &builder) throw()
01412 : ThatStar(builder)
01413 {
01414
01415
01416
01417
01418
01419 addInstanceOf("CustomThatStar");
01420 }
01421
01433 virtual void setAttribute(const StringPimpl &name, const StringPimpl &value)
01434 throw(InternalProgrammerErrorException &)
01435 {
01436 string stringValue(value.c_str());
01437 m_value = stringValue;
01438 }
01439
01451 virtual StringPimpl getString() const
01452 throw(InternalProgrammerErrorException &)
01453 {
01454 if(!m_value.empty())
01455 {
01456 string returnString("<thatstar");
01457 returnString += " index=\"" + m_value + "\"/>";
01458 return returnString.c_str();
01459 }
01460 else
01461 {
01462 string returnString("<thatstar/>");
01463 return returnString.c_str();
01464 }
01465
01466 }
01467
01468 private:
01469
01473 string m_value;
01474 };
01475
01480 class CustomThink : public Think
01481 {
01482 public:
01483
01488 CustomThink() throw()
01489 {
01490
01491
01492
01493
01494
01495 addInstanceOf("CustomThink");
01496 }
01497
01509 virtual StringPimpl getString() const
01510 throw(InternalProgrammerErrorException &)
01511 {
01512 string returnString("<think>");
01513 returnString += InnerTemplateListImpl::getString().c_str();
01514 returnString += "</think>";
01515 return returnString.c_str();
01516 }
01517 };
01518
01523 class CustomTopicStar : public TopicStar
01524 {
01525 public:
01526
01537 CustomTopicStar(GraphBuilderFramework &builder) throw()
01538 : TopicStar(builder)
01539 {
01540
01541
01542
01543
01544
01545 addInstanceOf("CustomTopicStar");
01546 }
01547
01559 virtual void setAttribute(const StringPimpl &name, const StringPimpl &value)
01560 throw(InternalProgrammerErrorException &)
01561 {
01562 string stringValue(value.c_str());
01563 m_value = stringValue;
01564 }
01565
01577 virtual StringPimpl getString() const
01578 throw(InternalProgrammerErrorException &)
01579 {
01580 if(!m_value.empty())
01581 {
01582 string returnString("<topicstar");
01583 returnString += " index=\"" + m_value + "\"/>";
01584 return returnString.c_str();
01585 }
01586 else
01587 {
01588 string returnString("<topicstar/>");
01589 return returnString.c_str();
01590 }
01591
01592 }
01593
01594 private:
01595
01599 string m_value;
01600 };
01601
01606 class CustomUpperCase : public UpperCase
01607 {
01608 public:
01609
01614 CustomUpperCase() throw()
01615 {
01616
01617
01618
01619
01620
01621 addInstanceOf("CustomUpperCase");
01622 }
01623
01635 virtual StringPimpl getString() const
01636 throw(InternalProgrammerErrorException &)
01637 {
01638 string returnString("<uppercase>");
01639 returnString += InnerTemplateListImpl::getString().c_str();
01640 returnString += "</uppercase>";
01641 return returnString.c_str();
01642 }
01643 };
01644
01649 class CustomVersion : public Version
01650 {
01651 public:
01652
01663 CustomVersion(GraphBuilderFramework &builder) throw()
01664 : Version(builder)
01665 {
01666
01667
01668
01669
01670
01671 addInstanceOf("CustomVersion");
01672 }
01673
01685 virtual StringPimpl getString() const
01686 throw(InternalProgrammerErrorException &)
01687 {
01688 string returnString("<version/>");
01689 return returnString.c_str();
01690 }
01691 };
01692
01693 }
01694 }
01695
01696 #ifdef _WIN32
01697 # pragma warning ( pop )
01698 #endif
01699
01700 #endif