// MsIdxI.cpp creates Index.HTM with table listing _.jpg files & child directories #include // CFindFile ... #include // cin,cout,cerr #include // strstr, strchr , strnicmp #include // ofstream void main(int argc, char *argv[]) { int iScrnBaseHeight = 600; BOOL bNS4 = false; if ( argc > 2 ) { if ( strnicmp(argv[2],"-NS4",4) == 0) { bNS4 = true; } else if ( atoi(argv[2]) > 599 ) { iScrnBaseHeight = atoi(argv[2]); } } if ( argc > 1 ) { if ( strnicmp(argv[1],"-NS4",4) == 0) { bNS4 = true; } else if ( atoi(argv[1]) > 599 ) { iScrnBaseHeight = atoi(argv[1]); } } // iScrnBaseHeight = 600; // iScrnBaseHeight = 768; // iScrnBaseHeight = 864; // iScrnBaseHeight = 1024; // iScrnBaseHeight = 1200; int ipHeight = (int) (iScrnBaseHeight * 0.825); int iphWidth = (int) (iScrnBaseHeight * 1.1); int ipvWidth = (int) (iScrnBaseHeight * 0.619); fstream ofIndex ("INDEX.HTML", ios::out); int pdest; CString string; CString result; CString folderTitle; ofIndex << " Clark Anderson - Recent JPEG Photos " << endl; ofIndex << " " << endl; if ( bNS4 ) { ofIndex << " " << endl; // ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; } else { ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; } CFileFind finder; CFileFind findhtm; BOOL bWorking = finder.FindFile("*."); bWorking = finder.FindNextFile(); string = (LPCTSTR) finder.GetRoot() ; pdest = string.ReverseFind( '\\'); folderTitle = string.Mid(pdest+1); bWorking = finder.FindFile("*.jpg"); BOOL bImage = finder.FindFile("*.jpg"); if (bImage) { ofIndex << " " << endl; } ofIndex << " " << endl; if (bImage) { ofIndex << "
" << endl; ofIndex << "" << endl; ofIndex << "" << endl; ofIndex << "
" << endl; if (bNS4) { ofIndex << "" << " " << endl; ofIndex << " " << endl; ofIndex << "" << " " << endl; } // ofIndex << "" << " " << endl; ofIndex << "" << endl; // ofIndex << "" << " " " << endl; } //08sep2009 + vvvvvvvvvvvvvvvvvvvvvvvvvvvvv ofIndex << " " << endl; ofIndex << "" << endl; ofIndex << "" << endl; ofIndex << "
" << endl; //08sep2009 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ofIndex << " " << endl; ofIndex << " " << endl; if (bImage) { bWorking = finder.FindFile("*.jpg"); while (bWorking) { bWorking = finder.FindNextFile(); result = string = (LPCTSTR) finder.GetFileTitle() ; result.MakeUpper(); if ((result.Find("MAP") > 0) || (result.Find("RUTE") > 0) || (result.Find("BOOK") > 0)) { fstream ofIMG (string+".HTM", ios::out); ofIMG << "Clark Anderson - Recent JPEG Photos " << endl; ofIMG << "" << endl; ofIMG << "" << endl; ofIMG << " " << endl; ofIMG.close(); ofIndex << "" << endl; } result = (LPCTSTR) finder.GetFileTitle() ; result = result.Right(1); if (result.Compare("v")==0) { ofIndex << "" << endl; } else { ofIndex << "" << endl; } } } bWorking = finder.FindFile("*.txt"); while (bWorking) { bWorking = finder.FindNextFile(); ofIndex << "" << endl; } bWorking = finder.FindFile("*"); while (bWorking) { bWorking = finder.FindNextFile(); if( finder.IsDirectory() & !finder.IsDots() ) { ofIndex << "" << endl; } } ofIndex << "
" << folderTitle << " Folder
" << (LPCTSTR) finder.GetFileTitle() << " Reduced Photo
" << (LPCTSTR) finder.GetFileTitle() << " Photo
" << (LPCTSTR) finder.GetFileTitle() << " Photo
" << (LPCTSTR) finder.GetFileTitle() << " Text
---> " << (LPCTSTR) finder.GetFileTitle() << " Folder

" << endl; if (bImage) { if (bNS4) { ofIndex << "" << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << " " << endl; ofIndex << "" << " " << endl; } // ofIndex << "" << " " << endl; //08sep2009 + vvvvvvvvvvvvvvvvvvvvvvvvvvvvv ofIndex << "
" << endl; ofIndex << "" << endl; ofIndex << "" << endl; ofIndex << "
" << endl; ofIndex << "
" << endl; ofIndex << "















" << endl; ofIndex << "
" << endl; ofIndex << "" << endl; ofIndex << "" << endl; ofIndex << "
" << endl; ofIndex << "
" << endl; ofIndex << "
" << endl; //08sep2009 + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ofIndex << "" << endl; // ofIndex << "" << " " << endl; } ofIndex << " " << endl; ofIndex.close(); }