/*************************************************************************/ /* DUCTAPE Version 2.0 */ /* Copyright (C) 2001 */ /* Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik */ /* University of Oregon, Department of Computer and Information Science */ /*************************************************************************/ /*??? #include */ #include #include #include #include #ifdef _OLD_HEADER_ # include # include # include #else # include using std::ifstream; using std::ofstream; # include using std::set; # include using std::sort; #endif #include "pdbAll.h" //---------------------------------------------------------------------- #define NUMBER_OF_KEYWORDS 73 static const char *keywords[NUMBER_OF_KEYWORDS] = { "and", "and_eq", "asm", "auto", "bitand", "bitor", "bool", "break", "case", "catch", "char", "class", "compl", "const", "const_cast", "continue", "default", "delete", "do", "double", "dynamic_cast", "else", "enum", "explicit", "extern", "false", "float", "for", "friend", "goto", "if", "inline", "int", "long", "mutable", "namespace", "new", "not", "not_eq", "operator", "or", "or_eq", "private", "protected", "public", "register", "reinterpret_cast", "return", "short", "signed", "sizeof", "static", "static_cast", "struct", "switch", "template", "this", "throw", "true", "try", "typedef", "typeid", "typename", "union", "unsigned", "using", "virtual", "void", "volatile", "wchar_t", "while", "xor", "xor_eq" }; //---------------------------------------------------------------------- struct ltstr { bool operator()(const char* s1, const char* s2) const { return strcmp(s1, s2) < 0; } }; //---------------------------------------------------------------------- static bool itemCmp(const pdbSimpleItem* i1, const pdbSimpleItem* i2) { return i1->name() < i2->name(); } //---------------------------------------------------------------------- static void out(ostream& ostr, char ch) { switch( ch ) { case '<': ostr << "<"; break; case '>': ostr << ">"; break; case '&': ostr << "&"; break; default : ostr << ch; break; } } //---------------------------------------------------------------------- static void outStr(ostream& ostr, const string& str) { for (unsigned i=0; iname == f2->name ) { return f1->original < f2->original; } else { return f1->name < f2->name; } } //---------------------------------------------------------------------- void exclude_this( string which, vector& rcsysfiles, string rcline ) { string::size_type path_location; if( ( which == "string" ) || ( string::npos == rcline.find_first_of( "/", 0 ) ) ) { path_location = rcline.find_last_of( " \t" ); if( path_location == string::npos ) return; ++path_location; if( path_location == string::npos ) return; string thing = rcline.substr(path_location); rcsysfiles.push_back(new filenamedata(rcline,thing,false,thing, thing,thing) ); } else { path_location = rcline.find_first_of( "/", 0 ); if( path_location == string::npos ) return; string name(""); string path = rcline.substr(path_location); path_location = path.find_last_of( "/" ); if( ++path_location != string::npos ) { name = path.substr(path_location); } rcsysfiles.push_back(new filenamedata(rcline,name,false,path, path,name) ); } } //---------------------------------------------------------------------- const int INBUF_SIZE = 2048; const int STYLE_SIZE = 32; const int COLOR_SIZE = 7; //---------------------------------------------------------------------- struct run_control { run_control() {} vector exclude_files; vector exclude_strings; vector read_src_files_from; filenamedata * write_html_files_to; filenamedata * find_doc_files_in; bool add_line_numbers; bool just_build_pdbhtmlrc_html; bool add_backtoindex_footer; bool list_methods_in_classes; bool add_doc_files; bool exit_on_missing_src_file; bool print_error_messages; bool print_warning_messages; char slash_replacement; char dot_replacement; char style_text[STYLE_SIZE]; char style_link[STYLE_SIZE]; char style_alink[STYLE_SIZE]; char style_vlink[STYLE_SIZE]; char style_comments[STYLE_SIZE]; char style_constants[STYLE_SIZE]; char style_preprocessor[STYLE_SIZE]; char style_linenumbers[STYLE_SIZE]; char style_target[STYLE_SIZE]; char style_keyword[STYLE_SIZE]; char color_bgcolor[COLOR_SIZE+1]; char color_text[COLOR_SIZE+1]; char color_link[COLOR_SIZE+1]; char color_alink[COLOR_SIZE+1]; char color_vlink[COLOR_SIZE+1]; char color_comments[COLOR_SIZE+1]; char color_constants[COLOR_SIZE+1]; char color_preprocessor[COLOR_SIZE+1]; char color_linenumbers[COLOR_SIZE+1]; char color_target[COLOR_SIZE+1]; char color_keyword[COLOR_SIZE+1]; }; //---------------------------------------------------------------------- void linenumbers( ostream& ostr, struct run_control * rc , int line, bool inComment, bool inPreStmt, bool * inPreFont ) { if( rc->add_line_numbers == true ) { if ( inComment ) { ostr << ""; if ( strlen( rc->style_comments ) > 0 ) { ostr << "style_comments << ">"; } } if ( strlen( rc->style_linenumbers ) > 0 ) { ostr << "<" << rc->style_linenumbers << ">"; } ostr << "" << line << ": "; if ( strlen( rc->style_linenumbers ) > 0 ) { ostr << "style_linenumbers << ">"; } if ( inComment && strlen( rc->style_comments ) > 0 ) { ostr << "<" << rc->style_comments << ">"; } if( inComment ) { ostr << ""; } if ( inPreStmt && strlen( rc->style_preprocessor ) > 0 ) { ostr << "<" << rc->style_preprocessor << ">"; } if( inPreStmt ) { ostr << ""; *inPreFont = true; } } } //---------------------------------------------------------------------- void build_pdbhtmlrc_html( struct run_control * rc ) { string writehere; if( rc->write_html_files_to ) { writehere = rc->write_html_files_to->path + "/" + "pdbhtmlrc.html"; } else { writehere = "pdbhtmlrc.html"; } ofstream html(writehere.c_str()); if (!html) { cerr << "Error: Cannot open 'pdbhtmlrc.html' for output." << endl; return; } html << "\n\n pdbhtmlrc \n\n" << "" << endl; html << "

Pdbhtmlrc Values and Example


" << endl; html << "" << endl; html << "" << endl; html << ""; html << " " << endl; html << "" << endl; html << "
"; html << "

Values

" << endl; html << "
"; html << "

Example

" << endl; html << "
"; html << "NOTE:
    "; html << "
  • The example will always display linenumbers.
    " << endl; html << "
  • Example links will be stale.
    " << endl; html <<"
  • color_bgcolor is the background color for this and all other pages."; html << endl << "

";



   if( 0 < strlen( rc->style_link ) ) {
      html << "<" << rc->style_link << ">";
   }
   html << " " << rc->color_link  << " "
        << rc->style_link << " color_link" << "" << endl;
   if( 0 < strlen( rc->style_link ) ) {
      html << "style_link << ">";
   }

   html << "
"; if( 0 < strlen( rc->style_alink ) ) { html << "<" << rc->style_alink << ">"; } html << "" << rc->color_alink << " " << rc->style_alink << " color_alink" << "" << endl; if( 0 < strlen( rc->style_alink ) ) { html << "style_alink << ">"; } html << "
"; if( 0 < strlen( rc->style_vlink ) ) { html << "<" << rc->style_vlink << ">"; } html << "" << rc->color_vlink << " " << rc->style_vlink << " color_vlink" << "" << endl; if( 0 < strlen( rc->style_vlink ) ) { html << "style_vlink << ">"; } html << "
"; if( 0 < strlen( rc->style_comments ) ) { html << "<" << rc->style_comments << ">"; } html << "" << rc->color_comments << " " << rc->style_comments << " color_comments" << "" << endl; if( 0 < strlen( rc->style_comments ) ) { html << "style_comments << ">"; } html << "
"; if( 0 < strlen( rc->style_constants ) ) { html << "<" << rc->style_constants << ">"; } html << "" << rc->color_constants << " " << rc->style_constants << " color_constants" << "" << endl; if( 0 < strlen( rc->style_constants ) ) { html << "style_constants << ">"; } html << "
"; if( 0 < strlen( rc->style_preprocessor ) ) { html << "<" << rc->style_preprocessor << ">"; } html << "" << rc->color_preprocessor << " " << rc->style_preprocessor << " color_preprocessor" << "" << endl; if( 0 < strlen( rc->style_preprocessor ) ) { html << "style_preprocessor << ">"; } html << "
"; if( 0 < strlen( rc->style_linenumbers ) ) { html << "<" << rc->style_linenumbers << ">"; } html << "" << rc->color_linenumbers << " " << rc->style_linenumbers << " color_linenumbers" << "" << endl; if( 0 < strlen( rc->style_linenumbers ) ) { html << "style_linenumbers << ">"; } if( 0 < strlen( rc->style_target ) ) { html << "<" << rc->style_target << ">"; } html << "" << rc->color_target << " " << rc->style_target << " color_target" << ""; if( 0 < strlen( rc->style_target ) ) { html << "style_target << ">"; } html << "
"; if( 0 < strlen( rc->style_keyword ) ) { html << "<" << rc->style_keyword << ">"; } html << "" << rc->color_keyword << " " << rc->style_keyword << " color_keyword" << "" << endl; if( 0 < strlen( rc->style_keyword ) ) { html << "style_keyword << ">"; } html << "
"; html << "
"; html << "" << endl; html << "" << endl; html << "" << endl; html << "" << endl; html << "" << endl; html << "" << endl; html << "" << endl; html << "" << endl; html << "" << endl; html << "" << endl; html << "
"; html << "Add_line_numbers" ; if( 1 == rc->add_line_numbers ) { html << "True"<< endl; } else { html << "False"<< endl; } html << "
"; html << "Add_backtoindex_footer" ; if( 1 == rc->add_backtoindex_footer ) { html << " True"<< endl; } else { html << " False"<< endl; } html << "
"; html << "List_methods_in_classes" ; if( 1 == rc->list_methods_in_classes ) { html << " True"<< endl; } else { html << " False"<< endl; } html << "
"; html << "Just_build_pdbhtmlrc_html" ; if( 1 == rc->just_build_pdbhtmlrc_html ) { html << " True"<< endl; } else { html << " False"<< endl; } html << "
"; html << "Add_doc_files" ; if( 1 == rc->add_doc_files ) { html << " True"<< endl; } else { html << " False"<< endl; } html << "
"; html << "Exit_on_missing_src_file" ; if( 1 == rc->exit_on_missing_src_file ) { html << " True"<< endl; } else { html << " False"<< endl; } html << "
"; html << "Print_error_messages" ; if( 1 == rc->print_error_messages ) { html << " True"<< endl; } else { html << " False"<< endl; } html << "
"; html << "Print_warning_messages" ; if( 1 == rc->print_warning_messages ) { html << " True"<< endl; } else { html << " False"<< endl; } html << "
" << endl; html << "
"; html << "" << "" << endl; html << "" << endl; html << ""; html << "" << endl; html << "" << "
slash_replacement" << rc->slash_replacement << "
dot_replacement " << rc->dot_replacement << "
" << endl; html << "
"; html << "Exclude these files:" << endl; vector::iterator vi; if( rc->exclude_files.empty() ) { html << "
No files are specified.
" << endl; } else { for( vi = rc->exclude_files.begin(); vi != rc->exclude_files.end(); vi++ ) { html << "
" << (*vi)->name.c_str() ; } html << "
"; } html << "
Exclude these strings:" << endl; if( rc->exclude_strings.empty() ) { html << "
No strings are specified.
" << endl; } else { for( vi=rc->exclude_strings.begin(); vi != rc->exclude_strings.end(); vi++ ) { html << "
" << (*vi)->name.c_str() ; } html << "
"; } html << "
"; html << "
Read source files from:" << endl; if( rc->read_src_files_from.empty() ) { html << "
No directory paths are specified.
" << endl; } else { for( vi=rc->read_src_files_from.begin(); vi != rc->read_src_files_from.end(); vi++ ) { html << "
" << (*vi)->path.c_str() ; } html << "
"; } html << "
Write html files to" << endl; if( rc->write_html_files_to ) { html << "
" << rc->write_html_files_to->path.c_str() << "
"; } else { html << "
No directory paths are specified.
" << endl; } html << "
Find doc files in" << endl; if( rc->find_doc_files_in ) { html << "
" << rc->find_doc_files_in->path.c_str() << "
"; } else { html << "
No directory paths are specified.
" << endl; } html << "
" << endl; /*********************************************************************************/ html << "
" << endl;

html << "<" << rc->style_linenumbers << ">1:style_linenumbers << ">";
html << "<" << rc->style_comments<< ">";
html << "/*************************************************************************/" 
     << "style_comments<< ">" << endl;

html << "<" << rc->style_linenumbers << ">2:style_linenumbers << ">";
html << "<" << rc->style_comments<< ">";
html << "/* DUCTAPE Version 1.0                                                   */" 
     << "style_comments<< ">" << endl;

html << "<" << rc->style_linenumbers << ">3:style_linenumbers << ">";
html << "<" << rc->style_comments<< ">";
html << "/* Copyright (C) 2001                                                    */" 
     << "style_comments<< ">" << endl;

html << "<" << rc->style_linenumbers << ">4:style_linenumbers << ">";
html << "<" << rc->style_comments<< ">";
html << "/* Forschungszentrum Juelich, Zentralinstitut fuer Angewandte Mathematik */" 
     << "style_comments<< ">" << endl;

html << "<" << rc->style_linenumbers << ">5:style_linenumbers << ">";
html << "<" << rc->style_comments<< ">";
html << "/* University of Oregon, Department of Computer and Information Science  */" 
     << "style_comments<< ">" << endl;

html << "<" << rc->style_linenumbers << ">6:style_linenumbers << ">";
html << "<" << rc->style_comments<< ">";
html << "/*************************************************************************/" 
     << "style_comments<< ">" << endl;


html << "<" << rc->style_linenumbers << ">7:style_linenumbers << ">" << endl;

html << "<" << rc->style_linenumbers << ">8:style_linenumbers << ">";
html << "<" << rc->style_preprocessor<< ">#ifndef __PDB_ROUTINE_H__" << "style_preprocessor << ">" << endl;



html << "<" << rc->style_linenumbers << ">9:style_linenumbers << ">";
html << "<" << rc->style_preprocessor << ">#define __PDB_ROUTINE_H__" << "style_preprocessor << ">" << endl;


html << "<" << rc->style_linenumbers << ">10:style_linenumbers << ">" << endl;



html << "<" << rc->style_linenumbers << ">11:style_linenumbers << ">";
html << "<" << rc->style_preprocessor << ">#include \"pdbTemplateItem.h\"" 
     << "style_preprocessor << ">" << endl;



html << "<" << rc->style_linenumbers << ">12:style_linenumbers << ">" << endl;
html << "<" << rc->style_linenumbers << ">13:style_linenumbers << ">";
html << "<" << rc->style_preprocessor << ">#define  THIS    1" << "style_preprocessor << ">" << endl;
html << "<" << rc->style_linenumbers << ">14:style_linenumbers << ">";
html << "<" << rc->style_preprocessor << ">#define  THAT    2" << "style_preprocessor << ">" << endl;
html << "<" << rc->style_linenumbers << ">15:style_linenumbers << ">" << endl;


html << "<" << rc->style_linenumbers << ">16:style_linenumbers << ">";
html << "<" << rc->style_keyword<< ">class style_keyword << ">";
html << "<" << rc->style_target << ">pdbRoutine";
html << "style_target << "> : " ;
html << "<" << rc->style_keyword<< "> public style_keyword << ">" ;
html << "pdbTemplateItem {" << endl;

html << "<" << rc->style_linenumbers << ">17:style_linenumbers << ">";
html << "<" << rc->style_keyword<< ">publicstyle_keyword << ">:" << endl;

html << "<" << rc->style_linenumbers << ">18:style_linenumbers << ">  "  ;
html << "<" << rc->style_target << ">pdbRoutine";
html << "style_target << ">(" ;

html << "<" << rc->style_keyword<< "> conststyle_keyword << "> string& name, " ;
html << "<" << rc->style_keyword<< "> intstyle_keyword << "> id) : " ;

html << "pdbTemplateItem(name, id)" << endl;

html << "<" << rc->style_linenumbers << ">19:style_linenumbers << ">    {}" << endl;
html << "<" << rc->style_linenumbers << ">20:style_linenumbers << ">"  ;

html << "<" << rc->style_keyword<< ">  virtualstyle_keyword << "> ~pdbRoutine();" ; 


html << "   <" << rc->style_comments << ">// dtorstyle_comments << ">" << endl;

html << "<" << rc->style_linenumbers << ">21:style_linenumbers << ">" << endl;

html << "<" << rc->style_linenumbers << ">22:style_linenumbers << ">"  ;

html << "<" << rc->style_keyword << ">  bool style_keyword;
html << "><" << rc->style_target << ">isVirtualstyle_target << "() ";
html << "<" << rc->style_keyword<< "> conststyle_keyword << "> {" << endl;


html << "<" << rc->style_linenumbers << ">23:style_linenumbers << ">"    ;
html << "<" << rc->style_keyword << ">   returnstyle_keyword << "> v == ";
html << "<" << rc->style_constants << ">0 style_constants << ">|| v == " ;
html << "<" << rc->style_constants << ">7 style_constants << ">|| v == " ;
html << "<" << rc->style_constants << ">THAT style_constants << ">;" << endl;


html << "<" << rc->style_linenumbers << ">24:style_linenumbers << ">  }" << endl;
html << "<" << rc->style_linenumbers << ">25:style_linenumbers << ">" << endl;

html << "<" << rc->style_linenumbers << ">26:style_linenumbers << ">" ;
html << "<" << rc->style_keyword << ">  virtual style_keyword << ">";
html << "<" << rc->style_keyword << ">void style_keyword;
html << "><" << rc->style_target << ">processstyle_target << ">(";
html << "PDB *p);" << endl;


html << "<" << rc->style_linenumbers << ">27:style_linenumbers << ">" << endl   ;
html << "<" << rc->style_linenumbers << ">28:style_linenumbers << ">" ;
html << "<" << rc->style_keyword<< ">privatestyle_keyword << ">:" << endl;

html << "<" << rc->style_linenumbers << ">29:style_linenumbers << ">" ;
html << "<" << rc->style_keyword<< ">  const style_keyword << ">" ;
html << "pdbType     *<";
html << rc->style_target << ">sigstyle_target << ">;" << endl;


html << "<" << rc->style_linenumbers << ">30:style_linenumbers << ">" ;
html << "  virt_t             v" << endl;


html << "<" << rc->style_linenumbers << ">31:style_linenumbers << ">" ;
html << "<" << rc->style_keyword << ">  bool style_keyword << ">              crvo;" << endl;

html << "<" << rc->style_linenumbers << ">32:style_linenumbers << ">" ;
html << "<" << rc->style_keyword << ">  int style_keyword << ">               n;" << endl;

html << "<" << rc->style_linenumbers << ">33:style_linenumbers << ">};" << endl;

html << "<" << rc->style_linenumbers << ">34:style_linenumbers << ">" << endl;

html << "<" << rc->style_linenumbers << ">34:style_linenumbers << ">";
html << "<" << rc->style_preprocessor << ">#endif" << "style_preprocessor << ">" << endl;
html << "
\n"; html << "Back to Index\n"; html << "
Key to Colors and Styles\n"; html << "
" << endl; html << "
\n"; html << "\n\n"; html.close(); } //---------------------------------------------------------------------- struct run_control * readpdbhtmlrc() { struct run_control * rc = new run_control(); rc->find_doc_files_in = 0; rc->write_html_files_to = 0; rc->add_line_numbers = false; rc->just_build_pdbhtmlrc_html = false; rc->add_backtoindex_footer = true; rc->list_methods_in_classes = true; rc->add_doc_files = false; rc->exit_on_missing_src_file = false; rc->print_error_messages = false; rc->print_warning_messages = false; rc->slash_replacement = '_'; rc->dot_replacement = '_'; strcpy( rc->style_text, "strong" ); strcpy( rc->style_vlink, "tt" ); strcpy( rc->style_link, "em" ); strcpy( rc->style_alink, "tt" ); strcpy( rc->style_comments, "em" ); strcpy( rc->style_constants, "tt" ); strcpy( rc->style_preprocessor, "sup" ); strcpy( rc->style_linenumbers, "tt" ); strcpy( rc->style_target, "big" ); strcpy( rc->style_keyword, "strong" ); strcpy( rc->color_bgcolor, "#ffffff" ); strcpy( rc->color_text, "#111111" ); strcpy( rc->color_link, "#000ff0" ); strcpy( rc->color_alink, "#3300ff" ); strcpy( rc->color_vlink, "#3388dd" ); strcpy( rc->color_comments, "#9911bb" ); strcpy( rc->color_constants, "#ff3f00" ); strcpy( rc->color_preprocessor, "#408000" ); strcpy( rc->color_linenumbers, "#904000" ); strcpy( rc->color_target, "#c00000" ); strcpy( rc->color_keyword, "#881088" ); ifstream pdbhtmlrc("pdbhtmlrc"); if (!pdbhtmlrc) { cerr << "Error: Cannot open 'pdbhtmlrc'" << endl; return rc; } static char inbuf[INBUF_SIZE]; string rcline(""); string parm(""); while ( pdbhtmlrc.getline(inbuf, INBUF_SIZE) ) { const string ignore_letters(" \t"); const string first_letters("tf"); string::size_type parm_location; rcline = inbuf; // Colors if( 0 == rcline.find( "color_bgcolor" ) ) { strcpy( rc->color_bgcolor, rcline.substr(rcline.find('#'), COLOR_SIZE ).c_str() ); } else if ( 0 == rcline.find( "color_text" ) ) { strcpy( rc->color_text, rcline.substr(rcline.find('#'), COLOR_SIZE ).c_str() ); } else if ( 0 == rcline.find( "color_vlink" ) ) { strcpy( rc->color_vlink, rcline.substr(rcline.find('#'), COLOR_SIZE ).c_str() ); } else if ( 0 == rcline.find( "color_link" ) ) { strcpy( rc->color_link, rcline.substr(rcline.find('#'), COLOR_SIZE ).c_str() ); } else if ( 0 == rcline.find( "color_alink" ) ) { strcpy( rc->color_alink, rcline.substr(rcline.find('#'), COLOR_SIZE ).c_str() ); } else if ( 0 == rcline.find( "color_comments" ) ) { strcpy( rc->color_comments, rcline.substr(rcline.find('#'), COLOR_SIZE ).c_str() ); } else if ( 0 == rcline.find( "color_constants" ) ) { strcpy( rc->color_constants, rcline.substr(rcline.find('#'), COLOR_SIZE ).c_str() ); } else if ( 0 == rcline.find( "color_preprocessor" ) ) { strcpy( rc->color_preprocessor, rcline.substr(rcline.find('#'), COLOR_SIZE ).c_str() ); } else if ( 0 == rcline.find( "color_linenumbers" ) ) { strcpy( rc->color_linenumbers, rcline.substr(rcline.find('#'), COLOR_SIZE ).c_str() ); } else if ( 0 == rcline.find( "color_keyword" ) ) { strcpy( rc->color_keyword, rcline.substr(rcline.find('#'), COLOR_SIZE ).c_str() ); // Styles } else if ( 0 == rcline.find( "style_text" ) ) { parm_location = rcline.find_first_not_of( ignore_letters, sizeof("style_text") ); if( parm_location == string::npos ) continue; strcpy( rc->style_text, rcline.substr(parm_location).c_str() ); } else if ( 0 == rcline.find( "style_vlink" ) ) { parm_location = rcline.find_first_not_of( ignore_letters, sizeof("style_vlink") ); if( parm_location == string::npos ) continue; strcpy( rc->style_vlink, rcline.substr(parm_location).c_str() ); } else if ( 0 == rcline.find( "style_link" ) ) { parm_location = rcline.find_first_not_of( ignore_letters, sizeof("style_link") ); if( parm_location == string::npos ) continue; strcpy( rc->style_link, rcline.substr(parm_location).c_str() ); } else if ( 0 == rcline.find( "style_alink" ) ) { parm_location = rcline.find_first_not_of( ignore_letters, sizeof("style_alink") ); if( parm_location == string::npos ) continue; strcpy( rc->style_alink, rcline.substr(parm_location).c_str() ); } else if ( 0 == rcline.find( "style_comments" ) ) { parm_location = rcline.find_first_not_of( ignore_letters, sizeof("style_comments") ); if( parm_location == string::npos ) continue; strcpy( rc->style_comments, rcline.substr(parm_location).c_str() ); } else if ( 0 == rcline.find( "style_constants" ) ) { parm_location = rcline.find_first_not_of( ignore_letters, sizeof("style_constants") ); if( parm_location == string::npos ) continue; strcpy( rc->style_constants, rcline.substr(parm_location).c_str() ); } else if ( 0 == rcline.find( "style_preprocessor" ) ) { parm_location=rcline.find_first_not_of( ignore_letters, sizeof("style_preprocessor" )); if( parm_location == string::npos ) continue; strcpy( rc->style_preprocessor, rcline.substr(parm_location).c_str() ); } else if ( 0 == rcline.find( "style_linenumbers" ) ) { parm_location=rcline.find_first_not_of( ignore_letters, sizeof("style_linenumbers" )); if( parm_location == string::npos ) continue; strcpy( rc->style_linenumbers, rcline.substr(parm_location).c_str() ); } else if ( 0 == rcline.find( "style_target" ) ) { parm_location=rcline.find_first_not_of( ignore_letters, sizeof("style_target" )); if( parm_location == string::npos ) continue; strcpy( rc->style_target, rcline.substr(parm_location).c_str() ); } else if ( 0 == rcline.find( "style_keyword" ) ) { parm_location=rcline.find_first_not_of( ignore_letters, sizeof("style_keyword" )); if( parm_location == string::npos ) continue; strcpy( rc->style_keyword, rcline.substr(parm_location).c_str() ); // Generics } else if ( 0 == rcline.find( "add_line_numbers" ) ) { parm_location = rcline.find_first_of( first_letters, sizeof("add_line_numbers") ); if( parm_location == string::npos ) continue; if( rcline.substr(parm_location,4) == "true" ) { rc->add_line_numbers = true; } else { rc->add_line_numbers = false; } } else if ( 0 == rcline.find( "list_methods_in_classes" ) ) { parm_location = rcline.find_first_of( first_letters, sizeof("list_methods_in_classes") ); if( parm_location == string::npos ) continue; if( rcline.substr(parm_location,4) == "true" ) { rc->list_methods_in_classes = true; } else { rc->list_methods_in_classes = false; } } else if ( 0 == rcline.find( "add_backtoindex_footer" ) ) { parm_location = rcline.find_first_of( first_letters, sizeof("add_backtoindex_footer") ); if( parm_location == string::npos ) continue; if( rcline.substr(parm_location,4) == "true" ) { rc->add_backtoindex_footer = true; } else { rc->add_backtoindex_footer = false; } } else if ( 0 == rcline.find( "just_build_pdbhtmlrc_html" ) ) { parm_location = rcline.find_first_of( first_letters, sizeof("just_build_pdbhtmlrc_html") ); if( parm_location == string::npos ) continue; if( rcline.substr(parm_location,4) == "true" ) { rc->just_build_pdbhtmlrc_html = true; } else { rc->just_build_pdbhtmlrc_html = false; } } else if ( 0 == rcline.find( "exit_on_missing_src_file" ) ) { parm_location = rcline.find_first_of( first_letters, sizeof("exit_on_missing_src_file") ); if( parm_location == string::npos ) continue; if( rcline.substr(parm_location,4) == "true" ) { rc->exit_on_missing_src_file = true; } else { rc->exit_on_missing_src_file = false; } } else if ( 0 == rcline.find( "print_error_messages" ) ) { parm_location = rcline.find_first_of( first_letters, sizeof("print_error_messages") ); if( parm_location == string::npos ) continue; if( rcline.substr(parm_location,4) == "true" ) { rc->print_error_messages = true; } else { rc->print_error_messages = false; } } else if ( 0 == rcline.find( "print_warning_messages" ) ) { parm_location = rcline.find_first_of( first_letters, sizeof("print_warning_messages") ); if( parm_location == string::npos ) continue; if( rcline.substr(parm_location,4) == "true" ) { rc->print_warning_messages = true; } else { rc->print_warning_messages = false; } } else if ( 0 == rcline.find( "slash_replacement" ) ) { parm_location = rcline.find_first_not_of( ignore_letters, sizeof("slash_replacement") ); if( parm_location == string::npos ) continue; rc->slash_replacement = rcline.at(parm_location); } else if ( 0 == rcline.find( "dot_replacement" ) ) { parm_location = rcline.find_first_not_of( ignore_letters, sizeof("dot_replacement") ); if( parm_location == string::npos ) continue; rc->dot_replacement = rcline.at(parm_location); } else if ( 0 == rcline.find( "exclude_this_file" ) ) { exclude_this( "file", rc->exclude_files, rcline ); } else if ( 0 == rcline.find( "exclude_this_string" ) ) { exclude_this( "string", rc->exclude_strings, rcline ); } else if( 0 == rcline.find( "read_src_files_from" ) ) { parm_location = rcline.find_first_not_of( ignore_letters, sizeof("read_src_files_from") ); string path = rcline.substr(parm_location); rc->read_src_files_from.push_back(new filenamedata(path)); } else if( 0 == rcline.find( "write_html_files_to" ) ) { parm_location = rcline.find_first_not_of( ignore_letters, sizeof("write_html_files_to") ); string path = rcline.substr(parm_location); rc->write_html_files_to = new filenamedata(path); } else if( 0 == rcline.find( "find_doc_files_in" ) ) { parm_location = rcline.find_first_not_of( ignore_letters, sizeof("find_doc_files_in") ); string path = rcline.substr(parm_location); rc->find_doc_files_in = new filenamedata(path); } rcline = ""; } pdbhtmlrc.close(); build_pdbhtmlrc_html( rc ) ; return rc; } //---------------------------------------------------------------------- static bool isExcludedFile( struct run_control * rc, filenamedata * thisfile ) { if( (filenamedata*) 0 == thisfile ) { return 1; } vector::iterator vi; vector& excludefile = rc->exclude_files; for( vi = excludefile.begin(); vi != excludefile.end(); vi++ ) { if( string::npos != thisfile->original.find((*vi)->name.c_str()) ) { return 1; } } vector& excludestring = rc->exclude_strings; for( vi = excludestring.begin(); vi != excludestring.end(); vi++ ) { if( string::npos != thisfile->original.find((*vi)->name.c_str()) ) { return 1; } } return 0; } //---------------------------------------------------------------------- const char *accessToName(pdbItem::access_t v) { switch (v) { case pdbItem::AC_PUB : return " public "; case pdbItem::AC_PRIV: return " private "; case pdbItem::AC_PROT: return " protected "; case pdbItem::AC_NA : default : return " NA "; } } //---------------------------------------------------------------------- filenamedata * getFileNameData( string fname, vector usefiles ) { vector::iterator vi; for( vi = usefiles.begin(); vi != usefiles.end(); vi++ ) { if ( (*vi)->name == fname ) { return( *vi ); } } return( (filenamedata *) 0 ); } //---------------------------------------------------------------------- string getSourceLine( struct filenamedata * names, int line ) { const char * fileName = names->path.c_str(); ifstream grab; grab.open(fileName); if (!grab) { cerr << "Error: Cannot open !!! for output." << endl; return "Yikes! I can't open this file! Really Weird!" ; } int lineinfile = 0; char c; string returnMe; --line; while( lineinfile != line ) { grab.get(c); if( c == '\n' ) ++lineinfile; } char lastc = '?'; do { grab.get(c); if( c == '\n' ) continue; if( ( c == ' ' || c == '\t' ) && ( lastc == ' ' || lastc == '\t') ) continue; lastc = c; returnMe += c; } while( ( c != ';') && (c != '{' ) ); return returnMe; } //---------------------------------------------------------------------- static void generateIndex( PDB& pdb, ostream& ostr, const char *pdbfile, struct run_control * rc, vector usefiles, const map& isItem ) { bool printed; bool foundit; cout << "Generating index.html ..." << endl; ostr << "\n\n" << pdbfile << " Index\n\n" << "\n

Index of " << pdbfile << "

\n" << "
Key to Colors and Styles" << "

\n"; //-------------------------------------------- ostr << "

Files:

\n\n"; //-------------------------------------------- if( rc->list_methods_in_classes == 1 ) { ostr << "

Classes and Methods:

\n