Add some comments to common package (#2216)

This commit is contained in:
JinmingHu 2021-05-07 13:01:26 +08:00 committed by GitHub
parent 30dfa8d668
commit 3c04ad93a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View File

@ -12,8 +12,18 @@
namespace Azure { namespace Storage {
/**
* @brief The class for the CRC64 hash function which maps binary data of an arbitrary length to
* small binary data of a fixed length.
*/
class Crc64Hash : public Azure::Core::Cryptography::Hash {
public:
/**
* @brief Concatenates another #Crc64 instance after this instance. This operation has the same
* effect as if the data in the other instance was appened to this instance.
*
* @param other Another #Crc64Hash instance to be concatenated after this instance.
*/
void Concatenate(const Crc64Hash& other);
~Crc64Hash() override = default;

View File

@ -13,12 +13,29 @@
namespace Azure { namespace Storage {
/**
* @brief An exception thrown when storage service request fails.
*/
struct StorageException : public Azure::Core::RequestFailedException
{
/**
* @brief Constructs a #StorageException with a message.
*
* @param message The explanatory string.
*/
explicit StorageException(const std::string& message) : RequestFailedException(message) {}
/**
* Some storage-specific information in response body.
*/
std::map<std::string, std::string> AdditionalInformation;
/**
* @brief Constructs a #StorageException from a failed storage service response.
*
* @param response Raw HTTP response from storage service.
* @return #StorageException.
*/
static StorageException CreateFromResponse(
std::unique_ptr<Azure::Core::Http::RawResponse> response);
};