Home | History | Annotate | Download | only in unicode
      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 
     17 #ifndef __STD_STRING_H__
     18 #define __STD_STRING_H__
     19 
     20 /**
     21  * \file
     22  * \brief C++ API: Central ICU header for including the C++ standard <string>
     23  *                 header and for related definitions.
     24  */
     25 
     26 #include "unicode/utypes.h"
     27 
     28 /**
     29  * \def U_HAVE_STD_STRING
     30  * Define whether the standard C++ (STL) <string> header is available.
     31  * @internal
     32  */
     33 #ifndef U_HAVE_STD_STRING
     34 #define U_HAVE_STD_STRING 1
     35 #endif
     36 
     37 #if U_HAVE_STD_STRING
     38 
     39 #include <string>
     40 
     41 /**
     42  * \def U_STD_NS
     43  * Define the namespace to use for standard C++ (STL) classes.
     44  * Either std or empty.
     45  * @draft ICU 4.2
     46  */
     47 
     48 /**
     49  * \def U_STD_NSQ
     50  * Define the namespace qualifier to use for standard C++ (STL) classes.
     51  * Either std:: or empty.
     52  * For example,
     53  *   U_STD_NSQ string StringFromUnicodeString(const UnicodeString &unistr);
     54  * @draft ICU 4.2
     55  */
     56 
     57 /**
     58  * \def U_STD_NS_USE
     59  * This is used to specify that the rest of the code uses the
     60  * standard (STL) namespace.
     61  * Either "using namespace std;" or empty.
     62  * @draft ICU 4.2
     63  */
     64 #ifndef U_STD_NSQ
     65 #   if U_HAVE_NAMESPACE
     66 #       define U_STD_NS std
     67 #       define U_STD_NSQ U_STD_NS::
     68 #       define U_STD_NS_USE using namespace U_STD_NS;
     69 #   else
     70 #       define U_STD_NS
     71 #       define U_STD_NSQ
     72 #       define U_STD_NS_USE
     73 #   endif
     74 #endif
     75 
     76 #endif  // U_HAVE_STD_STRING
     77 
     78 #endif  // __STD_STRING_H__
     79