| 662 | } |
| 663 | |
| 664 | static bool dumpEngineDocs( const char *outputFile ) |
| 665 | { |
| 666 | // Create the output stream. |
| 667 | FileStream stream; |
| 668 | if ( !stream.open( outputFile, Torque::FS::File::Write ) ) |
| 669 | { |
| 670 | Con::errorf( "dumpEngineDocs - Failed to open output file." ); |
| 671 | return false; |
| 672 | } |
| 673 | |
| 674 | // First dump all global ConsoleDoc fragments. |
| 675 | |
| 676 | for( ConsoleDocFragment* fragment = ConsoleDocFragment::smFirst; fragment != NULL; fragment = fragment->mNext ) |
| 677 | if( !fragment->mClass ) |
| 678 | dumpFragment( stream, fragment ); |
| 679 | |
| 680 | // Clear the doc groups before continuing, |
| 681 | smDocGroups.clear(); |
| 682 | |
| 683 | // Dump enumeration types. |
| 684 | dumpEnums( stream ); |
| 685 | |
| 686 | // Dump all global variables. |
| 687 | dumpVariables( stream ); |
| 688 | |
| 689 | // Now dump the global functions. |
| 690 | Namespace *g = Namespace::find( NULL ); |
| 691 | while( g ) |
| 692 | { |
| 693 | dumpNamespaceEntries( stream, g ); |
| 694 | |
| 695 | // Dump callbacks. |
| 696 | dumpGroupStart( stream, "Callbacks" ); |
| 697 | dumpNamespaceEntries( stream, g, true ); |
| 698 | dumpGroupEnd( stream ); |
| 699 | |
| 700 | g = g->mParent; |
| 701 | } |
| 702 | |
| 703 | // Now dump all the classes. |
| 704 | dumpClasses( stream ); |
| 705 | |
| 706 | // Dump pre-declarations for any groups we encountered |
| 707 | // so that we don't have to explicitly define them. |
| 708 | HashTable<String,U32>::Iterator iter = smDocGroups.begin(); |
| 709 | for (; iter != smDocGroups.end(); ++iter) |
| 710 | stream.writeText( String::ToString( "/*! @addtogroup %s */\r\n\r\n", iter->key.c_str() ) ); |
| 711 | |
| 712 | return true; |
| 713 | } |
| 714 | |
| 715 | DefineEngineFunction( dumpEngineDocs, bool, ( const char* outputFile ),, |
| 716 | "Dumps the engine scripting documentation to the specified file overwriting any existing content.\n" |
no test coverage detected