string login = VariablesMap["login"].as<string>();
string password = VariablesMap["password"].as<string>();
- //TODO: convert protocol option to lowercase
+ protocol = to_lower(protocol);
Service::Ptr service = create_service(protocol,host,login,password);
if ( service )
/**
+ * Converts first ten characters of given string to lowercase.
+ * @param input String.
+ * @return String in lowercase.
+ */
+string Config::to_lower(string input)
+{
+ int i = 0;
+ while ( input[i] && i<10 )
+ {
+ input[i] = tolower(input[i]);
+ i++;
+ }
+ return input;
+}
+
+
+/**
* Loads a service config file, invoked by load_config_from_files.
* @param full_filename Filename of the service config file to load.
* @return 0 if all is fine, -1 otherwise.
string login = vm["login"].as<string>();
string password = vm["password"].as<string>();
- // TODO: convert protocol to lowercase
- //protocol = tolower(protocol.c_str());
+ protocol = to_lower(protocol);
Service::Ptr service = create_service(protocol,host,login,password);
if ( service )
Service::Ptr create_service(const std::string&,const std::string&,const std::string&,const std::string&);
int load_main_config_file(const std::string&);
int load_service_config_file(const std::string&);
+ std::string to_lower(std::string);
public: