Changeset 165 for trunk/gsdl/src/recpt/action.cpp
- Timestamp:
- 1999-02-22T11:33:58+13:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/action.cpp
r158 r165 12 12 /* 13 13 $Log$ 14 Revision 1.6 1999/02/21 22:33:52 rjmcnab 15 16 Lots of stuff :-) 17 14 18 Revision 1.5 1999/02/11 01:24:04 rjmcnab 15 19 … … 56 60 } 57 61 62 // configure should be called once for each configuration line 63 // the default version configures the default for any arguments 64 // which this action uses 65 void action::configure (const text_t &key, const text_tarray &cfgline) { 66 cgiarginfo *info = NULL; 67 if ((key == "argdefault") && (cfgline.size() == 2) && 68 ((info = argsinfo.getarginfo(cfgline[0])) != NULL)) { 69 if (info->defaultstatus <= cgiarginfo::config) { 70 info->defaultstatus = cgiarginfo::config; 71 info->argdefault = cfgline[1]; 72 } 73 } 74 } 75 76 // init should be called after all the configuration is done but 77 // before any other methods are called 78 bool action::init (ostream &/*logout*/) { 79 return true; 80 } 81 58 82 // returns the "a" argument value that will specify this action 59 83 // this name should be short but does not have to be one character … … 92 116 // from outputing anything. 93 117 bool action::do_action (cgiargsclass &/*args*/, outconvertclass &/*outconvert*/, 94 ostream &/*textout*/, ostream &/*logout*/) { 118 recptproto */*collectproto*/, ostream &/*textout*/, 119 ostream &/*logout*/) { 95 120 return true; 96 }97 98 // configure should be called once for each configuration line99 // the default version configures the default for any arguments100 // which this action uses101 void action::configure (const text_t &key, const text_tarray &cfgline) {102 cgiarginfo *info = NULL;103 if ((key == "argdefault") && (cfgline.size() == 2) &&104 ((info = argsinfo.getarginfo(cfgline[0])) != NULL)) {105 if (info->defaultstatus <= cgiarginfo::config) {106 info->defaultstatus = cgiarginfo::config;107 info->argdefault = cfgline[1];108 }109 }110 121 } 111 122 112 123 113 124 114 actionmapclass::actionmapclass () { 115 } 116 117 // theaction becomes the property of this class after addaction 118 // therefore theaction should always be created using new but 119 // not deleted after the call to addaction. 125 // theaction remains the property of the calling code but 126 // should not be deleted until it is removed from this list. 120 127 void actionmapclass::addaction (action *theaction) { 121 128 // can't add a null action … … 130 137 aptr.a = theaction; 131 138 actionptrs[theaction->get_action_name()] = aptr; 132 aptr.a = NULL; // control has passed on133 139 } 134 140 135 141 // getaction will return NULL if the action could not be found 136 142 action *actionmapclass::getaction (const text_t &key) { 143 // can't find an action with no name 144 assert (!key.empty()); 145 if (key.empty()) return NULL; 146 137 147 iterator here = actionptrs.find (key); 138 148 if (here == actionptrs.end()) return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.