You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
5.5 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: pantheios/inserters/fmt.hpp
  3. *
  4. * Purpose: Format constants for Pantheios inserter classes.
  5. *
  6. * Created: 21st June 2005
  7. * Updated: 6th August 2012
  8. *
  9. * Home: http://www.pantheios.org/
  10. *
  11. * Copyright (c) 2005-2012, Matthew Wilson and Synesis Software
  12. * Copyright (c) 1999-2005, Synesis Software and Matthew Wilson
  13. * All rights reserved.
  14. *
  15. * Redistribution and use in source and binary forms, with or without
  16. * modification, are permitted provided that the following conditions are
  17. * met:
  18. *
  19. * - Redistributions of source code must retain the above copyright notice,
  20. * this list of conditions and the following disclaimer.
  21. * - Redistributions in binary form must reproduce the above copyright
  22. * notice, this list of conditions and the following disclaimer in the
  23. * documentation and/or other materials provided with the distribution.
  24. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the
  25. * names of any contributors may be used to endorse or promote products
  26. * derived from this software without specific prior written permission.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  29. * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  30. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  31. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  32. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  33. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  34. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  35. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  36. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  37. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  38. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  39. *
  40. * ////////////////////////////////////////////////////////////////////// */
  41. /** \file pantheios/inserters/fmt.hpp
  42. *
  43. * [C++ only] Format constants for Pantheios inserter classes.
  44. */
  45. #ifndef PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_FMT
  46. #define PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_FMT
  47. /* /////////////////////////////////////////////////////////////////////////
  48. * Version information
  49. */
  50. #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
  51. # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_FMT_MAJOR 2
  52. # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_FMT_MINOR 0
  53. # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_FMT_REVISION 12
  54. # define PANTHEIOS_VER_PANTHEIOS_INSERTERS_HPP_FMT_EDIT 23
  55. #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
  56. /* /////////////////////////////////////////////////////////////////////////
  57. * Includes
  58. */
  59. #ifndef PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS
  60. # include <pantheios/pantheios.h>
  61. #endif /* !PANTHEIOS_INCL_PANTHEIOS_H_PANTHEIOS */
  62. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  63. # include <stlsoft/stlsoft.h>
  64. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  65. /* /////////////////////////////////////////////////////////////////////////
  66. * Namespace
  67. */
  68. #if !defined(PANTHEIOS_NO_NAMESPACE)
  69. namespace pantheios
  70. {
  71. #endif /* !PANTHEIOS_NO_NAMESPACE */
  72. /* /////////////////////////////////////////////////////////////////////////
  73. * Enumerations
  74. */
  75. /** Format constants used by Pantheios inserter classes.
  76. *
  77. * \ingroup group__application_layer_interface__inserters
  78. *
  79. * These constants control the formatting of some of the
  80. * \ref group__application_layer_interface__inserters "inserter classes",
  81. * for example:
  82. *
  83. * \code
  84. pantheios::log_NOTICE("Integer: ", pantheios::integer(10, pantheios::fmt::fullHex);
  85. pantheios::log_NOTICE("Pointer: ", pantheios::pointer(NULL, 8 | pantheios::fmt::hex | pantheios::fmt::zeroPad);
  86. * \endcode
  87. *
  88. */
  89. struct fmt
  90. {
  91. enum
  92. {
  93. zeroXPrefix = 0x0100 /*!< Applies a \c 0x prefix to the output. \note This is ignored unless \link pantheios::fmt::hex hex\endlink is also specified. */
  94. , zeroPad = 0x0200 /*!< Zero-pads the output. Ignored when explicitly left-aligning. */
  95. #if defined(PANTHEIOS_OBSOLETE) || \
  96. defined(PANTHEIOS_DOCUMENTATION_SKIP_SECTION)
  97. , zeroPadded = zeroPad /*!< \deprecated This flag is deprecated, and may be removed in a future version; instead use the \link pantheios::fmt::zeroPad zeroPad\endlink flag. */
  98. #endif /* PANTHEIOS_OBSOLETE */
  99. , hex = 0x0400 /*!< Represents the output in hexadecimal. */
  100. , fullHex = zeroXPrefix | zeroPad | hex /*!< A combination of the \link pantheios::fmt::zeroXPrefix zeroXPrefix\endlink, \link pantheios::fmt::zeroPad zeroPad\endlink and \link pantheios::fmt::hex hex\endlink flags */
  101. #ifndef PANTHEIOS_DOCUMENTATION_SKIP_SECTION
  102. , showPlus = 0x0800 /*!< [PROVISIONAL] Shows a leading plus '+' for positively valued numeric arguments. */
  103. #endif /* !PANTHEIOS_DOCUMENTATION_SKIP_SECTION */
  104. };
  105. }; // namespace fmt
  106. /* /////////////////////////////////////////////////////////////////////////
  107. * Namespace
  108. */
  109. #if !defined(PANTHEIOS_NO_NAMESPACE)
  110. } /* namespace pantheios */
  111. #endif /* !PANTHEIOS_NO_NAMESPACE */
  112. /* /////////////////////////////////////////////////////////////////////////
  113. * Inclusion
  114. */
  115. #ifdef STLSOFT_PPF_pragma_once_SUPPORT
  116. # pragma once
  117. #endif /* STLSOFT_PPF_pragma_once_SUPPORT */
  118. /* ////////////////////////////////////////////////////////////////////// */
  119. #endif /* !PANTHEIOS_INCL_PANTHEIOS_INSERTERS_HPP_FMT */
  120. /* ///////////////////////////// end of file //////////////////////////// */