コード例 #1
0
ファイル: MooseEnumBase.C プロジェクト: Liuux/moose
void
MooseEnumBase::deprecate(const std::string & name, const std::string & new_name)
{
  std::string upper(name);
  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);

  std::string upper_new(new_name);
  std::transform(upper_new.begin(), upper_new.end(), upper_new.begin(), ::toupper);

  _deprecated_names[upper] = upper_new;

  checkDeprecated();
}
コード例 #2
0
ファイル: MooseEnumBase.C プロジェクト: aashiquear/moose
void
MooseEnumBase::deprecate(const std::string & name, const std::string & raw_name)
{
  std::set<MooseEnumItem>::const_iterator deprecated = find(name);
  if (deprecated == _items.end())
    mooseError("Cannot deprecate the enum item ", name, ", is not an available value.");

  std::set<MooseEnumItem>::const_iterator replaced = find(raw_name);
  if (replaced == _items.end())
    mooseError("Cannot deprecate the enum item ",
               name,
               ", since the replaced item ",
               raw_name,
               " it is not an available value.");

  _deprecated_items.emplace(std::make_pair(*deprecated, *replaced));
  checkDeprecated();
}