how can i use parameter file in itpp

Help
Furqan
2013-08-15
2013-08-19
  • Furqan
    Furqan
    2013-08-15

    Respected Sir,i need your help.....I want that my code read parammeter from parameter file but it is taking only default values.

    int main(int argc, char *argv[])
    {
    string id = "default"; // id
    for (int i = 1; i < argc; i++)
    {
    if (!strcmp(argv[i],"-id")) id = (string) argv[i+1];
    }
    //system( ("bash "+id).c_str() ); //compile the binary configuration file

    //Configuration file scan
    Config * cfg;

    cfg = new Config(".cfg");

    string cfg_id = cfg->get_value("id","default");

    //cout << id+": Using configuration file \""+cfg_id+".cfg\"" << endl;

    int ce = cfg->get_value("ce", 110);//channel estimation method
    cout<<"the value of ce "<<ce<<endl; int="" swp_prm_no="cfg-">get_swp_prm_no();

     
  • Bogdan Cristea
    Bogdan Cristea
    2013-08-16

    There is o class Config in IT++, but there is Parser class with similar functionality:

    http://itpp.sourceforge.net/4.3.1/group__parser.html

    If you need more help, please provide a working example.

     
    • Furqan
      Furqan
      2013-08-19

      Thanxalot Sir