X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fappli%2FbbRegeneratePackageDoc%2FbbRegeneratePackageDoc.cpp;h=9faa7d56b429a860da732a44964672510b24ddca;hb=7dea96c3fd3343fc15372ae61573ad5354b19ffc;hp=bc1fc449b84f220655c7e02a910bf88ce49cf1a6;hpb=b838e74e8b1e67f28442e6394f9220f41a7d546a;p=bbtk.git diff --git a/kernel/appli/bbRegeneratePackageDoc/bbRegeneratePackageDoc.cpp b/kernel/appli/bbRegeneratePackageDoc/bbRegeneratePackageDoc.cpp index bc1fc44..9faa7d5 100644 --- a/kernel/appli/bbRegeneratePackageDoc/bbRegeneratePackageDoc.cpp +++ b/kernel/appli/bbRegeneratePackageDoc/bbRegeneratePackageDoc.cpp @@ -7,85 +7,98 @@ //========================================================================== void RegenerateDoc ( bbtk::Package::Pointer p, std::string& doc_path ) { - std::string pack_name(p->GetName()); - std::string pack_path = doc_path + pack_name; - // Creating directory - if ( ! bbtk::Utilities::FileExists(pack_path) ) - { - std::string command("mkdir \"" +pack_path+ "\""); - system( command.c_str() ); - } - std::string pack_index(pack_path); - pack_index += bbtk::ConfigurationFile::GetInstance().Get_file_separator(); - pack_index += "index.html"; + std::string pack_name(p->GetName()); + std::string pack_path = doc_path + pack_name; + // Creating directory + if ( ! bbtk::Utilities::FileExists(pack_path) ) + { + std::string command("mkdir \"" +pack_path+ "\""); + system( command.c_str() ); + } + std::string pack_index(pack_path); + pack_index += bbtk::ConfigurationFile::GetInstance().Get_file_separator(); + pack_index += "index.html"; + + std::cout << "* Generating doc for package '"<SetDocURL(pack_index); + p->SetDocRelativeURL("index.html"); + p->CreateHtmlPage(pack_index,"bbtk",pack_name,"","",0,0,false); //true); +} - std::cout << "* Generating doc for '"<SetDocURL(pack_index); - p->SetDocRelativeURL("index.html"); - p->CreateHtmlPage(pack_index,"bbtk",pack_name,"","",0,0,true); + +void Usage() +{ + std::cout << "usage : bbRegeneratePackageDoc [|-a] [-q|-v]" + << std::endl + << " -a : All packages"<SetCommandLine(true); + I->SetThrow(false); + I->InterpretLine( "exec freeze"); + if (pack != "-a") { - pack = std::string(argv[1]); + I->InterpretLine( "include "+pack); + I->InterpretLine( "include "+pack+"-appli"); + RegenerateDoc(I->GetExecuter()->GetFactory()->GetPackage(pack),doc_path); } - else + else { - std::cout << "usage : bbRegeneratePackageDoc [package-name]" << std::endl; - return 0; + I->InterpretLine( "include *"); + bbtk::Factory::PackageMapType::const_iterator i; + for (i = I->GetExecuter()->GetFactory()->GetPackageMap().begin(); + i != I->GetExecuter()->GetFactory()->GetPackageMap().end(); + ++i) + { + if (i->second->GetName()=="user") continue; + RegenerateDoc(i->second,doc_path); + } } - - try + } + catch (bbtk::Exception e) { - std::string doc_path = bbtk::ConfigurationFile::GetInstance().Get_doc_path(); - doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator(); - doc_path += "bbdoc"; - doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator(); - - bbtk::Interpreter::Pointer I = bbtk::Interpreter::New(); - I->SetCommandLine(true); - I->SetThrow(false); - I->InterpretLine( "exec freeze"); - I->InterpretLine( "include "+pack); - if (pack != "*") - { - I->InterpretLine( "include "+pack+"-appli"); - RegenerateDoc(I->GetExecuter()->GetFactory()->GetPackage(pack),doc_path); - } - else - { - bbtk::Factory::PackageMapType::const_iterator i; - for (i = I->GetExecuter()->GetFactory()->GetPackageMap().begin(); - i != I->GetExecuter()->GetFactory()->GetPackageMap().end(); - ++i) - { - RegenerateDoc(i->second,doc_path); - } - } - } - catch (bbtk::Exception e) - { - std::cout << "* ERROR : "<