default_width.hpp 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Copyright (c) 2001-2011 Hartmut Kaiser
  2. //
  3. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #if !defined(BOOST_SPIRIT_KARMA_DEFAULT_WIDTH_APR_07_2009_0912PM)
  6. #define BOOST_SPIRIT_KARMA_DEFAULT_WIDTH_APR_07_2009_0912PM
  7. #if defined(_MSC_VER)
  8. #pragma once
  9. #endif
  10. ///////////////////////////////////////////////////////////////////////////////
  11. //
  12. // The BOOST_KARMA_DEFAULT_FIELD_LENGTH specifies the default field length
  13. // to be used for padding.
  14. //
  15. ///////////////////////////////////////////////////////////////////////////////
  16. #if !defined(BOOST_KARMA_DEFAULT_FIELD_LENGTH)
  17. #define BOOST_KARMA_DEFAULT_FIELD_LENGTH 10
  18. #endif
  19. ///////////////////////////////////////////////////////////////////////////////
  20. //
  21. // The BOOST_KARMA_DEFAULT_FIELD_MAXWIDTH specifies the default maximal field
  22. // length to be used for the maxwidth directive.
  23. //
  24. ///////////////////////////////////////////////////////////////////////////////
  25. #if !defined(BOOST_KARMA_DEFAULT_FIELD_MAXWIDTH)
  26. #define BOOST_KARMA_DEFAULT_FIELD_MAXWIDTH 10
  27. #endif
  28. ///////////////////////////////////////////////////////////////////////////////
  29. //
  30. // The BOOST_KARMA_DEFAULT_COLUMNS specifies the default number of columns to
  31. // be used with the columns directive.
  32. //
  33. ///////////////////////////////////////////////////////////////////////////////
  34. #if !defined(BOOST_KARMA_DEFAULT_COLUMNS)
  35. #define BOOST_KARMA_DEFAULT_COLUMNS 5
  36. #endif
  37. ///////////////////////////////////////////////////////////////////////////////
  38. namespace boost { namespace spirit { namespace karma { namespace detail
  39. {
  40. ///////////////////////////////////////////////////////////////////////////
  41. struct default_width
  42. {
  43. operator int() const
  44. {
  45. return BOOST_KARMA_DEFAULT_FIELD_LENGTH;
  46. }
  47. };
  48. ///////////////////////////////////////////////////////////////////////////
  49. struct default_max_width
  50. {
  51. operator int() const
  52. {
  53. return BOOST_KARMA_DEFAULT_FIELD_MAXWIDTH;
  54. }
  55. };
  56. ///////////////////////////////////////////////////////////////////////////
  57. struct default_columns
  58. {
  59. operator int() const
  60. {
  61. return BOOST_KARMA_DEFAULT_COLUMNS;
  62. }
  63. };
  64. }}}}
  65. #endif