std_string.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. *******************************************************************************
  3. *
  4. * Copyright (C) 2009-2010, International Business Machines
  5. * Corporation and others. All Rights Reserved.
  6. *
  7. *******************************************************************************
  8. * file name: std_string.h
  9. * encoding: US-ASCII
  10. * tab size: 8 (not used)
  11. * indentation:4
  12. *
  13. * created on: 2009feb19
  14. * created by: Markus W. Scherer
  15. */
  16. #ifndef __STD_STRING_H__
  17. #define __STD_STRING_H__
  18. /**
  19. * \file
  20. * \brief C++ API: Central ICU header for including the C++ standard <string>
  21. * header and for related definitions.
  22. */
  23. #include "unicode/utypes.h"
  24. /**
  25. * \def U_HAVE_STD_STRING
  26. * Define whether the standard C++ (STL) <string> header is available.
  27. * @internal
  28. */
  29. #ifndef U_HAVE_STD_STRING
  30. #define U_HAVE_STD_STRING 1
  31. #endif
  32. #if U_HAVE_STD_STRING
  33. #include <string>
  34. /**
  35. * \def U_STD_NS
  36. * Define the namespace to use for standard C++ (STL) classes.
  37. * Either std or empty.
  38. * @draft ICU 4.2
  39. */
  40. /**
  41. * \def U_STD_NSQ
  42. * Define the namespace qualifier to use for standard C++ (STL) classes.
  43. * Either std:: or empty.
  44. * For example,
  45. * U_STD_NSQ string StringFromUnicodeString(const UnicodeString &unistr);
  46. * @draft ICU 4.2
  47. */
  48. /**
  49. * \def U_STD_NS_USE
  50. * This is used to specify that the rest of the code uses the
  51. * standard (STL) namespace.
  52. * Either "using namespace std;" or empty.
  53. * @draft ICU 4.2
  54. */
  55. #ifndef U_STD_NSQ
  56. # if U_HAVE_NAMESPACE
  57. # define U_STD_NS std
  58. # define U_STD_NSQ U_STD_NS::
  59. # define U_STD_NS_USE using namespace U_STD_NS;
  60. # else
  61. # define U_STD_NS
  62. # define U_STD_NSQ
  63. # define U_STD_NS_USE
  64. # endif
  65. #endif
  66. #endif // U_HAVE_STD_STRING
  67. #endif // __STD_STRING_H__