⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 descriptiveexception.ipp

📁 最新的版本ACE-5.6.8,刚从外文网上搬下,与大家分享.
💻 IPP
字号:
// file      : Utility/ExH/System/DescriptiveException.ipp
// author    : Boris Kolpackov <boris@kolpackov.net>
// copyright : Copyright (c) 2002-2003 Boris Kolpackov
// license   : http://kolpackov.net/license.html

#include <cstring>

namespace Utility
{
  namespace ExH
  {
    namespace System
    {
      // c-tor's & d-tor

      inline DescriptiveException::
      DescriptiveException () throw ()
      {
        description_[0] = '\0';
      }

      inline DescriptiveException::
      DescriptiveException (char const* description) throw ()
      {
        init (description);
      }

      inline DescriptiveException::
      DescriptiveException (std::string const& description) throw ()
      {
        try
        {
          init (description.c_str ());
        }
        catch (...)
        {
        }
      }

      inline DescriptiveException::
      DescriptiveException (DescriptiveException const& src) throw ()
        : Base ()
      {
        init (src.what ());
      }

      inline DescriptiveException::
      ~DescriptiveException () throw ()
      {
      }

      inline DescriptiveException& DescriptiveException::
      operator= (DescriptiveException const& src) throw ()
      {
        init (src.what ());
        return *this;
      }


      // accessors / modifiers

      inline void DescriptiveException::
      init (char const* description) throw ()
      {
        if (description != 0)
        {
          std::strncpy (description_, description, DESCRIPTION_SIZE - 1);
          description_[DESCRIPTION_SIZE - 1] = '\0';
        }
        else
        {
          description_[0] = '\0';
        }
      }

      inline char const* DescriptiveException::
      what () const throw ()
      {
        if (description_[0] != '\0')
        {
          return description_;
        }
        else
        {
          return Exception::what ();
        }
      }
    }
  }
}
//$Id: DescriptiveException.ipp 80826 2008-03-04 14:51:23Z wotte $

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -