void FarHrcSettings::writeProfileToRegistry()
{
  HRCParser* hrcParser = parserFactory->getHRCParser();
  FileTypeImpl* type = nullptr;

  SettingsControl ColorerSettings;
  ColorerSettings.rDeleteSubKey(0, HrcSettings);
  size_t hrc_subkey;
  hrc_subkey = ColorerSettings.rGetSubKey(0, HrcSettings);

  // enum all FileTypes
  for (int idx = 0; ; idx++) {
    type = static_cast<FileTypeImpl*>(hrcParser->enumerateFileTypes(idx));

    if (!type) {
      break;
    }

    if (type->getParamCount() && type->getParamUserValueCount()) { // params>0 and user values >0
      size_t type_subkey = ColorerSettings.rGetSubKey(hrc_subkey, type->getName()->getWChars());
      // enum all params
      std::vector<SString> type_params = type->enumParams();
      for (auto paramname = type_params.begin(); paramname != type_params.end(); ++paramname) {
        const String* v = type->getParamUserValue(*paramname);
        if (v != nullptr) {
          ColorerSettings.Set(type_subkey, paramname->getWChars(), v->getWChars());
        }
      }
    }
  }

}
void FarHrcSettings::writeProfileToRegistry()
{
  HRCParser *hrcParser = parserFactory->getHRCParser();
  FileTypeImpl *type = NULL;

  SettingsControl ColorerSettings;
  ColorerSettings.rDeleteSubKey(0,HrcSettings);
  size_t hrc_subkey;
  hrc_subkey = ColorerSettings.rGetSubKey(0,HrcSettings);

  // enum all FileTypes
  for (int idx = 0; ; idx++){
    type =(FileTypeImpl *) hrcParser->enumerateFileTypes(idx);

    if (!type){
      break;
    }

    const String *p, *v;
    if (type->getParamCount() && type->getParamNotDefaultValueCount()){// params>0 and user values >0
      size_t type_subkey = ColorerSettings.rGetSubKey(hrc_subkey,type->getName()->getWChars());
      // enum all params
      for (int i=0;;i++){
        p=type->enumerateParameters(i);
        if (!p){
          break;
        }
        v=type->getParamNotDefaultValue(*p);
        if (v!=NULL){
          ColorerSettings.Set(type_subkey,p->getWChars(),v->getWChars());
        }
      }
    }
  }

}