BVB Source Codes

mars Show codecvt_error_category.cpp Source code

Return Download mars: download codecvt_error_category.cpp Source code - Download mars Source code - Type:.cpp
  1. //  codecvt_error_category implementation file  ----------------------------------------//
  2.  
  3. //  Copyright Beman Dawes 2009
  4.  
  5. //  Distributed under the Boost Software License, Version 1.0.
  6. //  See http://www.boost.org/LICENSE_1_0.txt)
  7.  
  8. //  Library home page at http://www.boost.org/libs/filesystem
  9.  
  10. //--------------------------------------------------------------------------------------//
  11.  
  12. #include <boost/config/warning_disable.hpp>
  13.  
  14. // define BOOST_FILESYSTEM_SOURCE so that <boost/filesystem/config.hpp> knows
  15. // the library is being built (possibly exporting rather than importing code)
  16. #define BOOST_FILESYSTEM_SOURCE
  17.  
  18. #ifndef BOOST_SYSTEM_NO_DEPRECATED
  19. #  define BOOST_SYSTEM_NO_DEPRECATED
  20. #endif
  21.  
  22. #include <boost/filesystem/config.hpp>
  23. #include <boost/filesystem/path_traits.hpp>
  24. #include <boost/system/error_code.hpp>
  25. #include <locale>
  26. #include <vector>
  27. #include <cstdlib>
  28. #include <cassert>
  29.  
  30. //--------------------------------------------------------------------------------------//
  31.  
  32. namespace
  33. {
  34.   class codecvt_error_cat : public mars_boost::system::error_category
  35.   {
  36.   public:
  37.     codecvt_error_cat(){}
  38.     const char*   name() const BOOST_SYSTEM_NOEXCEPT;
  39.     std::string    message(int ev) const;
  40.   };
  41.  
  42.   const char* codecvt_error_cat::name() const BOOST_SYSTEM_NOEXCEPT
  43.   {
  44.     return "codecvt";
  45.   }
  46.  
  47.   std::string codecvt_error_cat::message(int ev) const
  48.   {
  49.     std::string str;
  50.     switch (ev)
  51.     {
  52.     case std::codecvt_base::ok:
  53.       str = "ok";
  54.       break;
  55.     case std::codecvt_base::partial:
  56.       str = "partial";
  57.       break;
  58.     case std::codecvt_base::error:
  59.       str = "error";
  60.       break;
  61.     case std::codecvt_base::noconv:
  62.       str = "noconv";
  63.       break;
  64.     default:
  65.       str = "unknown error";
  66.     }
  67.     return str;
  68.   }
  69.  
  70. } // unnamed namespace
  71.  
  72. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost
  73. {
  74.   namespace filesystem
  75.   {
  76.  
  77.     BOOST_FILESYSTEM_DECL const mars_boost::system::error_category& codecvt_error_category()
  78.     {
  79.       static const codecvt_error_cat  codecvt_error_cat_const;
  80.       return codecvt_error_cat_const;
  81.     }
  82.  
  83.   } // namespace filesystem
  84. } // namespace mars_boost
  85.  
downloadcodecvt_error_category.cpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top