32 {
static std::string
_type(
"sha" );
return _type; }
51 , _checksum( checksum )
53 switch ( checksum.size() )
128 WAR <<
"Can't determine type of " << checksum.size() <<
" byte checksum '" <<
_checksum <<
"'" << endl;
136 std::string msg =
str::form (
_(
"Dubious type '%s' for %u byte checksum '%s'"),
156 if ( input_r.good() && ! type_r.empty() )
160 if ( ! input_r.eof() ||
_checksum.empty() )
178 std::ostringstream str;
187 return str << std::string(
"NoCheckSum");
190 return str << ( obj.
type().empty() ? std::string(
"UNKNOWN") : obj.
type() ) <<
'-' << obj.
checksum();
195 const std::string & type( obj.
type() );
198 if ( ! type.empty() ) str <<
" type=\"" << type <<
"\"";
202 str <<
">" <<
checksum <<
"</checksum>";
212 {
return ! ( lhs == rhs ); }