| 112 | } |
| 113 | |
| 114 | void GroupTransformImpl::write(const ConstConfigRcPtr & config, |
| 115 | const char * formatName, |
| 116 | std::ostream & os) const |
| 117 | { |
| 118 | FileFormat* fmt = FormatRegistry::GetInstance().getFileFormatByName(formatName); |
| 119 | |
| 120 | if (!fmt) |
| 121 | { |
| 122 | std::ostringstream err; |
| 123 | err << "The format named '" << formatName; |
| 124 | err << "' could not be found. "; |
| 125 | throw Exception(err.str().c_str()); |
| 126 | } |
| 127 | |
| 128 | try |
| 129 | { |
| 130 | fmt->write(config, config->getCurrentContext(), *this, formatName, os); |
| 131 | } |
| 132 | catch (std::exception & e) |
| 133 | { |
| 134 | std::ostringstream err; |
| 135 | err << "Error writing format '" << formatName << "': "; |
| 136 | err << e.what(); |
| 137 | throw Exception(err.str().c_str()); |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | int GroupTransform::GetNumWriteFormats() noexcept |
| 142 | { |
nothing calls this directly
no test coverage detected