Exemplo n.º 1
0
void CmdLineOptions::add_optional(std::string const &name,
                                  std::string const &description,
                                  std::string const &default_value) {
  std::unique_lock<std::mutex> l(mutex_);
  if (is_arg(name) || is_switch(name)) {
    throw OptionDefined();
  }
  std::string niceName(name);
  trim(niceName);
  argOptionList_.push_back(StringOption(niceName, description, default_value));
}
Exemplo n.º 2
0
QString RetroShareLink::toHtml() const
{
    QString html = "<a href=\"" + toString() + "\"";

    QString linkTitle = title();
    if (!linkTitle.isEmpty()) {
        html += " title=\"" + linkTitle + "\"";
    }
    html += ">" + niceName() + "</a>" ;

    return html;
}
Exemplo n.º 3
0
void CmdLineOptions::add_switch(std::string const &name,
                                std::string const &description,
                                bool default_setting) {
  std::unique_lock<std::mutex> l(mutex_);
  if (is_arg(name) || is_switch(name)) {
    throw OptionDefined();
  }
  std::string niceName(name);
  trim(niceName);

  switchOptionList_.push_back(
      BoolOption(niceName, description, default_setting));
}
Exemplo n.º 4
0
void CmdLineOptions::add_required(std::string const &name,
                                  std::string const &description) {
  std::unique_lock<std::mutex> l(mutex_);

  if (is_arg(name) || is_switch(name)) {
    throw OptionDefined();
  }
  std::string niceName(name);
  trim(niceName);

  StringOption option(niceName, description, "");
  option.set_required(true);
  argOptionList_.push_back(option);
}