FACT++  1.0
void Configuration::PrintOptions ( ) const

Definition at line 649 of file Configuration.cc.

References fVariables, Max(), str, var(), and VarAsStr().

Referenced by AddEnv(), and Parse().

650 {
651  cout << "Options propagated to program:" << endl;
652 
653  int maxlen = 0;
654  for (map<string,po::variable_value>::const_iterator m=fVariables.begin();
655  m!=fVariables.end(); m++)
656  Max(maxlen, m->first.length());
657 
658  cout.setf(ios_base::left);
659 
660  // =============> Implement prining of options in use
661  for (map<string,po::variable_value>::const_iterator m=fVariables.begin();
662  m!=fVariables.end(); m++)
663  {
664  const po::variable_value &v = m->second;
665 
666  ostringstream str;
667 
668  if (v.value().type()==typeid(bool))
669  str << " bool";
670  if (v.value().type()==typeid(string))
671  str << " string";
672  if (v.value().type()==typeid(int16_t))
673  str << " int16_t";
674  if (v.value().type()==typeid(int32_t))
675  str << " int32_t";
676  if (v.value().type()==typeid(int64_t))
677  str << " int64_t";
678  if (v.value().type()==typeid(uint16_t))
679  str << " uint16_t";
680  if (v.value().type()==typeid(uint32_t))
681  str << " uint32_t";
682  if (v.value().type()==typeid(uint64_t))
683  str << " uint64_t";
684  if (v.value().type()==typeid(float))
685  str << " float";
686  if (v.value().type()==typeid(double))
687  str << " double";
688  if (v.value().type()==typeid(Hex<uint16_t>))
689  str << " Hex<uint16_t>";
690  if (v.value().type()==typeid(Hex<uint32_t>))
691  str << " Hex<uint32_t>";
692  if (v.value().type()==typeid(Hex<uint64_t>))
693  str << " Hex<uint64_t>";
694  if (v.value().type()==typeid(vector<string>))
695  str << " vector<string>";
696  if (v.value().type()==typeid(vector<int16_t>))
697  str << " vector<int16_t>";
698  if (v.value().type()==typeid(vector<int32_t>))
699  str << " vector<int32_t>";
700  if (v.value().type()==typeid(vector<int64_t>))
701  str << " vector<int64_t>";
702  if (v.value().type()==typeid(vector<uint16_t>))
703  str << " vector<uint16_t>";
704  if (v.value().type()==typeid(vector<uint32_t>))
705  str << " vector<uint32_t>";
706  if (v.value().type()==typeid(vector<uint64_t>))
707  str << " vector<uint64_t>";
708  if (v.value().type()==typeid(vector<float>))
709  str << " vector<float>";
710  if (v.value().type()==typeid(vector<double>))
711  str << " vector<double>";
712 
713  if (str.str().empty())
714  str << " unknown[" << v.value().type().name() << "]";
715 
716  const string var = VarAsStr(v);
717  cout << setw(maxlen) << m->first;
718  if (!var.empty())
719  cout << " = ";
720  cout << var << " #" << str.str();
721 
722  if (v.defaulted())
723  cout << " [default]";
724  if (v.empty())
725  cout << " [empty]";
726 
727  cout << endl;
728  }
729 
730  cout << endl;
731 }
char str[80]
Definition: test_client.c:7
po::typed_value< T > * var(T *ptr=0)
std::string VarAsStr(const po::variable_value &v) const
static void Max(int &val, const int &comp)
Helper function which return the max of the two arguments in the first argument.
Definition: Configuration.h:55
po::variables_map fVariables
URL for database connection (see Configuration::parse_database)
Definition: Configuration.h:41

+ Here is the call graph for this function:

+ Here is the caller graph for this function: