| 193 | } |
| 194 | |
| 195 | void Namespace::printNamespaceEntries(Namespace * g, bool dumpScript, bool dumpEngine ) |
| 196 | { |
| 197 | static bool inGroup = false; |
| 198 | |
| 199 | // Go through all the entries. |
| 200 | // Iterate through the methods of the namespace... |
| 201 | for(Entry *ewalk = g->mEntryList; ewalk; ewalk = ewalk->mNext) |
| 202 | { |
| 203 | char buffer[1024]; //< This will bite you in the butt someday. |
| 204 | int eType = ewalk->mType; |
| 205 | const char * funcName = ewalk->mFunctionName; |
| 206 | |
| 207 | if( ( eType == Entry::ScriptFunctionType ) && !dumpScript ) |
| 208 | continue; |
| 209 | |
| 210 | if( ( eType != Entry::ScriptFunctionType ) && !dumpEngine ) |
| 211 | continue; |
| 212 | |
| 213 | // If it's a function |
| 214 | if(eType >= Entry::ScriptFunctionType || eType == Entry::OverloadMarker) |
| 215 | { |
| 216 | if(eType==Entry::OverloadMarker) |
| 217 | { |
| 218 | // Deal with crap from the OverloadMarker case. |
| 219 | // It has no type information so we have to "correct" its type. |
| 220 | |
| 221 | // Find the original |
| 222 | eType = 8; |
| 223 | for(Entry *eseek = g->mEntryList; eseek; eseek = eseek->mNext) |
| 224 | { |
| 225 | if(!dStrcmp(eseek->mFunctionName, ewalk->cb.mGroupName)) |
| 226 | { |
| 227 | eType = eseek->mType; |
| 228 | break; |
| 229 | } |
| 230 | } |
| 231 | // And correct the name |
| 232 | funcName = ewalk->cb.mGroupName; |
| 233 | } |
| 234 | |
| 235 | // A quick note - if your usage field starts with a (, then it's auto-integrated into |
| 236 | // the script docs! Use this HEAVILY! |
| 237 | |
| 238 | // We add some heuristics here as well. If you're of the form: |
| 239 | // *.methodName(*) |
| 240 | // then we will also extract parameters. |
| 241 | |
| 242 | const char *use = ewalk->mUsage ? ewalk->mUsage : ""; |
| 243 | const char *bgn = dStrchr(use, '('); |
| 244 | const char *end = dStrchr(use, ')'); |
| 245 | const char *dot = dStrchr(use, '.'); |
| 246 | |
| 247 | while( *use == ' ' ) |
| 248 | use++; |
| 249 | |
| 250 | if(use[0] == '(') |
| 251 | { |
| 252 | if(!end) |
nothing calls this directly
no test coverage detected