diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-11 17:31:30 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-11 17:31:30 +0300 |
commit | c7365d80063dc7270ea5685ae65094a5af62acaf (patch) | |
tree | df6e0126dbd2fa7efd46d4a753cd78ecabe04711 /utils/common.hpp | |
parent | test: README update (diff) | |
download | aes-tools-c7365d80063dc7270ea5685ae65094a5af62acaf.tar.gz aes-tools-c7365d80063dc7270ea5685ae65094a5af62acaf.zip |
add utils/cxx
Diffstat (limited to 'utils/common.hpp')
-rw-r--r-- | utils/common.hpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/utils/common.hpp b/utils/common.hpp deleted file mode 100644 index af61a32..0000000 --- a/utils/common.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/** - * \file - * \author Egor Tensin <Egor.Tensin@gmail.com> - * \date 2015 - * \copyright This file is licensed under the terms of the MIT License. - * See LICENSE.txt for details. - */ - -#pragma once - -#include <aesni/all.h> - -#include <stdexcept> - -namespace aesni -{ - class ErrorDetailsThrowsInDestructor - { - public: - ErrorDetailsThrowsInDestructor() - { - aesni_make_error_success(get()); - } - - ~ErrorDetailsThrowsInDestructor() - { - if (m_impl.ec != AESNI_ERROR_SUCCESS) - throw std::runtime_error(aesni_strerror(m_impl.ec)); - } - - AesNI_ErrorDetails* get() { return &m_impl; } - - operator AesNI_ErrorDetails*() { return get(); } - - private: - AesNI_ErrorDetails m_impl; - }; -} |