| 76 | }; |
| 77 | |
| 78 | void printClassHeader(const char* usage, const char * className, const char * superClassName, const bool stub) |
| 79 | { |
| 80 | if(stub) |
| 81 | { |
| 82 | Con::printf("/// Stub class"); |
| 83 | Con::printf("/// "); |
| 84 | Con::printf("/// @note This is a stub class to ensure a proper class hierarchy. No "); |
| 85 | Con::printf("/// information was available for this class."); |
| 86 | } |
| 87 | |
| 88 | if((usage != NULL) && strlen(usage)) |
| 89 | { |
| 90 | // Copy Usage Document |
| 91 | S32 usageLen = dStrlen( usage ) + 1; |
| 92 | FrameTemp<char> usageStr( usageLen ); |
| 93 | dStrcpy( usageStr, usage, usageLen ); |
| 94 | |
| 95 | // Print Header |
| 96 | Con::printf( "/*!" ); |
| 97 | |
| 98 | // Print line by line, skipping the @field lines. |
| 99 | // |
| 100 | // fetch first line end |
| 101 | char *newLine = dStrchr( usageStr, '\n' ); |
| 102 | char *usagePtr = usageStr; |
| 103 | do |
| 104 | { |
| 105 | // Copy of one line |
| 106 | static char lineStr[2048] = {0}; |
| 107 | // Keyword will hold the last keyword (word following '@' or '\') encountered. |
| 108 | static char keyword[8] = {0}; |
| 109 | |
| 110 | S32 lineLen = 0; |
| 111 | |
| 112 | // If not the last line, increment pointer |
| 113 | if( newLine != NULL ) |
| 114 | { |
| 115 | *newLine = '\0'; |
| 116 | newLine ++; |
| 117 | } |
| 118 | |
| 119 | // Copy line and update usagePtr |
| 120 | dStrcpy( lineStr, usagePtr, 2048 ); |
| 121 | usagePtr = (newLine != NULL ) ? newLine : usagePtr; |
| 122 | lineLen = dStrlen( lineStr ); |
| 123 | |
| 124 | // Get the keyword. This is the first word after an '@' or '\'. |
| 125 | const char* tempkw = dStrchr( lineStr, '@' ); |
| 126 | if( !tempkw ) |
| 127 | tempkw = dStrchr( lineStr, '\\' ); |
| 128 | |
| 129 | // If we found a new keyword, set it, otherwise, keep using the |
| 130 | // most recently found. |
| 131 | if( tempkw ) |
| 132 | { |
| 133 | dStrncpy( keyword, tempkw + 1, 5 ); |
| 134 | keyword[5] = '\0'; |
| 135 | } |