]> Creatis software - bbtk.git/blob - kernel/appli/bbRegenerateBoxesLists/bbRegenerateBoxesLists.cpp
are now generated in user's .bbtk dir
[bbtk.git] / kernel / appli / bbRegenerateBoxesLists / bbRegenerateBoxesLists.cpp
1
2 #include <bbtkInterpreter.h>
3 #include <bbtkConfigurationFile.h>
4
5 //==========================================================================
6 int main(int argc, char **argv)
7 {
8   if (argc>1)
9     {
10       if (argv[1][1]=='q') 
11         bbtk::MessageManager::SetMessageLevel("max",0);
12       else if (argv[1][1]=='v')
13         bbtk::MessageManager::SetMessageLevel("all",9);          
14       else 
15         {
16           std::cout << "usage : bbRegenerateBoxesLists [-q|-v] (quiet or verbose)" << std::endl;
17           return 0;
18         }
19     }
20
21   try
22     {
23       bbtk::Interpreter::Pointer I = bbtk::Interpreter::New();
24       I->SetCommandLine(true);
25       I->SetThrow(false);
26       
27       
28       std::string doc_path = bbtk::ConfigurationFile::GetInstance().Get_doc_path();
29       doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
30       doc_path += "bbdoc";
31       doc_path += bbtk::ConfigurationFile::GetInstance().Get_file_separator();
32       
33       I->InterpretLine( "exec freeze_no_error");
34       I->InterpretLine( "include *");
35       I->GetExecuter()->GetFactory()->CreateHtmlIndex(bbtk::Factory::Initials,doc_path + "index-alpha.html");
36         I->GetExecuter()->GetFactory()->CreateHtmlIndex(bbtk::Factory::Packages,doc_path + "index-package.html");
37         I->GetExecuter()->GetFactory()->CreateHtmlIndex(bbtk::Factory::Categories,doc_path + "index-category.html");
38         I->GetExecuter()->GetFactory()->CreateHtmlIndex(bbtk::Factory::Adaptors,doc_path + "index-adaptors.html");
39         
40     }
41   catch (bbtk::Exception e)
42     {
43       std::cout << "* ERROR : "<<e.GetErrorMessage()<<std::endl;
44       return 1;
45     }
46   return 0;
47 }
48 //==========================================================================
49
50