open_mode.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright Andrey Semashev 2016.
  3. * Distributed under the Boost Software License, Version 1.0.
  4. * (See accompanying file LICENSE_1_0.txt or copy at
  5. * http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. /*!
  8. * \file open_mode.hpp
  9. * \author Andrey Semashev
  10. * \date 01.01.2016
  11. *
  12. * The header defines resource opening modes.
  13. */
  14. #ifndef BOOST_LOG_UTILITY_OPEN_MODE_HPP_INCLUDED_
  15. #define BOOST_LOG_UTILITY_OPEN_MODE_HPP_INCLUDED_
  16. #include <boost/log/detail/config.hpp>
  17. #include <boost/log/detail/header.hpp>
  18. #ifdef BOOST_HAS_PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. namespace boost {
  22. BOOST_LOG_OPEN_NAMESPACE
  23. namespace open_mode {
  24. //! Create a new resource; fail if exists already
  25. struct create_only_tag {} const create_only = create_only_tag();
  26. //! Opens an existing resource; fail if not exist
  27. struct open_only_tag {} const open_only = open_only_tag();
  28. //! Creates a new resource or opens an existing one
  29. struct open_or_create_tag {} const open_or_create = open_or_create_tag();
  30. } // namespace open_mode
  31. BOOST_LOG_CLOSE_NAMESPACE // namespace log
  32. } // namespace boost
  33. #include <boost/log/detail/footer.hpp>
  34. #endif // BOOST_LOG_UTILITY_OPEN_MODE_HPP_INCLUDED_