Changeset 8b486e
- Timestamp:
- May 26, 2008, 1:25:38 PM (17 years ago)
- Children:
- cfaf42
- Parents:
- 8dc9b3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/builder.cpp
r8dc9b3 r8b486e 706 706 * \param configuration config file structure 707 707 * \param *ConfigFileName pointer to config file name in **argv 708 * \param * ElementsFileName pointer to elements db file namein **argv708 * \param *PathToDatabases pointer to db's path in **argv 709 709 * \return exit code (0 - successful, all else - something's wrong) 710 710 */ 711 static int ParseCommandLineOptions(int argc, char **argv, molecule *&mol, periodentafel *&periode, config& configuration, char *&ConfigFileName, char *& ElementsFileName)711 static int ParseCommandLineOptions(int argc, char **argv, molecule *&mol, periodentafel *&periode, config& configuration, char *&ConfigFileName, char *&PathToDatabases) 712 712 { 713 713 element *finder; … … 723 723 clock_t start,end; 724 724 int argptr; 725 PathToDatabases = LocalPath; 725 726 726 727 if (argc > 1) { // config file specified as option … … 741 742 cout << "\t-b x1 x2 x3\tCenter atoms in domain with given edge lengths of (x1,x2,x3)." << endl; 742 743 cout << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl; 743 cout << "\t-e <file>\tSets the element database to be parsed from this file (default: elements.db in same dir as " << argv[0] << ")." << endl;744 cout << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl; 744 745 cout << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner and stores config files in same dir as config." << endl; 745 746 cout << "\t-h/-H/-?\tGive this help screen." << endl; … … 764 765 case 'e': 765 766 cout << "Using " << argv[argptr] << " as elements database." << endl; 766 ElementsFileName= argv[argptr];767 PathToDatabases = argv[argptr]; 767 768 argptr+=1; 768 769 break; … … 776 777 777 778 // 2. Parse the element database 778 if (periode->LoadPeriodentafel( ElementsFileName))779 if (periode->LoadPeriodentafel(PathToDatabases)) { 779 780 cout << Verbose(0) << "Element list loaded successfully." << endl; 780 else 781 periode->Output((ofstream *)&cout); 782 } else 781 783 cout << Verbose(0) << "Element list loading failed." << endl; 782 784 … … 955 957 delete(mol); 956 958 delete(periode); 957 return ( 0);959 return (1); 958 960 } 959 961 } else { // no arguments, hence scan the elements db 960 if (periode->LoadPeriodentafel( ElementsFileName))962 if (periode->LoadPeriodentafel(PathToDatabases)) 961 963 cout << Verbose(0) << "Element list loaded successfully." << endl; 962 964 else … … 997 999 // =========================== PARSE COMMAND LINE OPTIONS ==================================== 998 1000 j = ParseCommandLineOptions(argc, argv, mol, periode, configuration, ConfigFileName, ElementsFileName); 1001 if (j == 1) return 0; // just for -v and -h options 999 1002 if (j) return j; // something went wrong 1003 periode->Output((ofstream *)&cout); 1000 1004 1001 1005 // General stuff
Note:
See TracChangeset
for help on using the changeset viewer.