Esempio n. 1
0
  ////////////////////////////////////////////////////////////////////////
  // initialize the adaptor using the preferences, return false to
  // cancel adaptor loading
  bool adaptor::init(saga::impl::session *session,
          saga::ini::ini const& glob_ini, saga::ini::ini const& adap_ini)
  {
    if (adap_ini.has_section("cli")) {
      saga::ini::section s = adap_ini.get_section("cli");

      if (s.has_entry("binary_path")) {
    	  binary_path = s.get_entry("binary_path");
    	  std::cout << "binary_path = " << binary_path << std::endl;
      }

      if (s.has_section("description")) {
		saga::ini::section ss = s.get_section("description");

		std::string v = ss.get_entry(sja::description_job_contact);
		saga::url mailto(v);
		if (mailto.get_scheme() != "mailto" ||
			mailto.get_path().empty()  )
			// TODO mail address format check.
		{
		  return false;
		}
		job_contact = v;
      }
    }
    return true;
  }
 // cache ini section on init
 bool filesystem_adaptor::init (saga::impl::session  * s,
                          saga::ini::ini const & glob_ini,
                          saga::ini::ini const & adap_ini)
 {
   if ( adap_ini.has_section ("preferences") )
   {
     ini_ = adap_ini.get_section ("preferences").get_entries ();
   }
     
   return true;
 }