]>
git.saurik.com Git - wxWidgets.git/blob - utils/HelpGen/src/ripper_main.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Contrib. demo
4 // Author: Aleksandras Gluchovas
8 // Copyright: (c) Aleskandars Gluchovas
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include "wx/wxprec.h"
29 #include "markup.h" // get_HTML_markup_tags() will be used
31 #include "docripper.h"
32 #include "cjparser.h" // C++/Java will be parsed here
34 /***** Main funciton *****/
38 // NOTE:: under Windows this generator parses all .h files
39 // int the current directory
44 void main(int argc
, char** argv
)
46 cout
<< "C++/JAVA Source Documentation Generator (\"wxDocRipper\")" << endl
47 << "(C) 1998, Aleksandras Gluchovas (mailto:alex@soften.ktu.lt)"
53 // set up target script
54 gen
.SetScriptMarkupTags( get_HTML_markup_tags() );
56 // setup source langauge
57 CJSourceParser
* pParser
= new CJSourceParser();
61 // read process all files in the current directory
63 struct _finddata_t c_file
; // NT-specific?
66 hFile
= _findfirst( "*.h", &c_file
);
71 gen
.ProcessFile( c_file
.name
);
74 if ( _findnext( hFile
, &c_file
) == -1L )
82 << "*** storing source documenation into ./srcref.html ***"
85 if ( !gen
.SaveDocument( "srcref.html" ) )
87 cout
<< "\nERROR: document cannot be saved" << endl
;
91 cout
<< "\nno .h files found in this directory - You must be running Windows now :-)"
97 printf( "\nTotal %d file(s) processed, done.\n", total
);
103 // NOTE:: on platfroms other then Windows this generator parses all files
104 // given from the command line
106 int main(int argc
, char** argv
)
108 cout
<< "C++/JAVA Source Documentation Generator (\"wxDocRipper\")" << endl
109 << "(C) 1998, Aleksandras Gluchovas (mailto:alex@soften.ktu.lt)"
114 cout
<< "Usage: list of files with .h, .hpp, .cpp or .java extentions"
119 int from
= 1, no_dump
= 0;
121 if ( strcmp( argv
[1], "-x" ) == 0 )
129 // set up target script
130 gen
.SetScriptMarkupTags( get_HTML_markup_tags() );
132 // setup source langauge
133 CJSourceParser
* pParser
= new CJSourceParser();
137 for( int i
= from
; i
!= argc
; ++i
)
139 gen
.ProcessFile( argv
[i
] );
144 << "*** storing source documenation into ./srcref.html ***"
147 if ( !gen
.SaveDocument( "srcref.html" ) )
149 cout
<< "\nERROR: document cannot be saved" << endl
;
152 printf( "\nTotal %d file(s) processed, done.\n", argc
-from
);