mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
add default cases for hash_algorithm value traits serialization
This commit is contained in:
parent
07001e0c07
commit
f7db4b0248
|
@ -21,6 +21,7 @@
|
|||
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||
// @author: see AUTHORS file
|
||||
|
||||
#include <detail/default_case.hpp>
|
||||
#include <detail/xlsx_crypto.hpp>
|
||||
|
||||
namespace {
|
||||
|
@ -63,7 +64,7 @@ struct value_traits<xlnt::detail::hash_algorithm>
|
|||
return xlnt::detail::hash_algorithm::ripemd160;
|
||||
else if (hash_algorithm_string == "Whirlpool")
|
||||
return xlnt::detail::hash_algorithm::whirlpool;
|
||||
throw xlnt::exception(hash_algorithm_string);
|
||||
default_case(xlnt::detail::hash_algorithm::sha1);
|
||||
}
|
||||
|
||||
static std::string serialize(xlnt::detail::hash_algorithm algorithm, const serializer &)
|
||||
|
@ -91,6 +92,8 @@ struct value_traits<xlnt::detail::hash_algorithm>
|
|||
case xlnt::detail::hash_algorithm::whirlpool:
|
||||
return "Whirlpool";
|
||||
}
|
||||
|
||||
default_case("SHA1");
|
||||
}
|
||||
}; // struct value_traits<>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user