string_literal_fwd.hpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright Andrey Semashev 2007 - 2015.
  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 string_literal_fwd.hpp
  9. * \author Andrey Semashev
  10. * \date 24.06.2007
  11. *
  12. * The header contains forward declaration of a constant string literal wrapper.
  13. */
  14. #ifndef BOOST_LOG_UTILITY_STRING_LITERAL_FWD_HPP_INCLUDED_
  15. #define BOOST_LOG_UTILITY_STRING_LITERAL_FWD_HPP_INCLUDED_
  16. #include <string>
  17. #include <boost/log/detail/config.hpp>
  18. #ifdef BOOST_HAS_PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. namespace boost {
  22. BOOST_LOG_OPEN_NAMESPACE
  23. /*!
  24. * \brief String literal wrapper
  25. *
  26. * The \c basic_string_literal is a thin wrapper around a constant string literal.
  27. * It provides interface similar to STL strings, but because of read-only nature
  28. * of string literals, lacks ability to modify string contents. However,
  29. * \c basic_string_literal objects can be assigned to and cleared.
  30. *
  31. * The main advantage of this class comparing to other string classes is that
  32. * it doesn't dynamically allocate memory and therefore is fast, thin and exception safe.
  33. */
  34. template< typename CharT, typename TraitsT = std::char_traits< CharT > >
  35. class basic_string_literal;
  36. // Convenience typedefs
  37. #ifdef BOOST_LOG_USE_CHAR
  38. typedef basic_string_literal< char > string_literal; //!< String literal type for narrow characters
  39. #endif
  40. #ifdef BOOST_LOG_USE_WCHAR_T
  41. typedef basic_string_literal< wchar_t > wstring_literal; //!< String literal type for wide characters
  42. #endif
  43. BOOST_LOG_CLOSE_NAMESPACE // namespace log
  44. } // namespace boost
  45. #endif // BOOST_LOG_UTILITY_STRING_LITERAL_FWD_HPP_INCLUDED_