Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

DocxManagerError.h

Go to the documentation of this file.
00001 /**
00002 * @file         DocxManagerError.h
00003 * @brief    エラーを表すクラス
00004 *
00005 * @author       Nakashima h
00006 * @date     2021-10-06
00007 *
00008 * $Id: DocxManagerError.h 46 2022-07-15 09:03:22Z nakashima-h $
00009 *
00010 * Copyright (c) 2020-2022 Antenna House, Inc. All rights reserved.
00011 */
00012 
00013 #pragma once
00014 enum class DocxManagerErrorCode;
00015 #include <string>
00016 #include <unordered_map>
00017 
00018 /**
00019 * @brief    エラーを表すクラス
00020 */
00021 class DocxManagerError {
00022 private:
00023     static const std::unordered_map<DocxManagerErrorCode, std::string> m_errorcode_msg;
00024 public:
00025     /**
00026     * @brief    デフォルトコンストラクタ
00027     */
00028     DocxManagerError() noexcept {};
00029 
00030     /**
00031     * @brief  メッセージとエラーコードを指定するコンストラクタ
00032     * @param    message - エラーメッセージ
00033     * @param  docx_manager_error_code - エラーコード
00034     */
00035     DocxManagerError(std::string const& message,
00036         DocxManagerErrorCode const docx_manager_error_code) noexcept :
00037         m_message(message), m_docx_manager_error_code(docx_manager_error_code) {};
00038 
00039     /**
00040     * @brief  エラーコードを指定するコンストラクタ
00041     * @param  docx_manager_error_code - エラーコード
00042     */
00043     DocxManagerError(DocxManagerErrorCode const docx_manager_error_code) noexcept :
00044         m_message(m_errorcode_msg.at(docx_manager_error_code)), m_docx_manager_error_code(docx_manager_error_code) {};
00045 
00046     /**
00047     * @brief    デフォルトデストラクタ
00048     */
00049     ~DocxManagerError() {};
00050 
00051     /**
00052     * @brief    エラーメッセージを取得する
00053     * @retrun   エラーメッセージ
00054     */
00055     std::string getMessage() const noexcept;
00056 
00057     /**
00058     * @brief    エラーメッセージを設定する
00059     * @param    message - エラーメッセージ
00060     */
00061     void setMessage(std::string const& message) noexcept;
00062 
00063     /**
00064     * @brief    エラーコードを取得する
00065     * @retrun   エラーコード
00066     */
00067     DocxManagerErrorCode getDocxManagerErrorCode() const noexcept;
00068 
00069     /**
00070     * @brief    エラーコードを設定する
00071     * @param    docx_manager_error_code - エラーコード
00072     */
00073     void setDocxManagerErrorCode(DocxManagerErrorCode const docx_manager_error_code) noexcept;
00074 
00075     /**
00076     * @brief    例外送出
00077     */
00078     void throwDocxManagerError() const;
00079 
00080 private:
00081     /**
00082     * エラーコード
00083     */
00084     DocxManagerErrorCode m_docx_manager_error_code;
00085 
00086     /**
00087     * エラーメッセージ
00088     */
00089     std::string m_message;
00090 };

Generated on 19 Jan 2023 for Word API C/C++ Interface by Doxygen 1.3-rc2