This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] messages.html doc update



by request.

2002-01-30  Peter Schmid  <schmid@snake.iap.physik.tu-darmstadt.de>

	* docs/html/22_locale/messages.html: Fix example code.

Index: docs/html/22_locale/messages.html
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/docs/html/22_locale/messages.html,v
retrieving revision 1.3
diff -c -p -r1.3 messages.html
*** messages.html	2002/01/23 02:02:21	1.3
--- messages.html	2002/01/31 00:21:31
*************** documentation. Here's an idea of what is
*** 251,276 ****
  	<li> message converting, simple example using the GNU model.
  
  <pre>
  #include <locale>
  
  void test01()
  {
!   using namespace std;
!   typedef std::messages<char>::catalog catalog;
! 
!   // Set to the root directory of the libstdc++.mo catalogs.
!   const char* dir = LOCALEDIR;
!   locale loc_de("de_DE");
! 
!   // Cache the messages facet.
    const messages<char>& mssg_de = use_facet<messages<char> >(loc_de); 
  
!   // Check German (de_DE) locale.
!   catalog cat_de = mssg_de.open("libstdc++", loc_c, dir);
    string s01 = mssg_de.get(cat_de, 0, 0, "please");
    string s02 = mssg_de.get(cat_de, 0, 0, "thank you");
!   // s01 == "bitte" 
!   // s02 == "danke" 
    mssg_de.close(cat_de);
  }
  </pre>
--- 251,272 ----
  	<li> message converting, simple example using the GNU model.
  
  <pre>
+ include <iostream>
  #include <locale>
+ using namespace std;
  
  void test01()
  {
!   typedef messages<char>::catalog catalog;
!   const char* dir =
!   "/mnt/egcs/build/i686-pc-linux-gnu/libstdc++-v3/po/share/locale";  
    const messages<char>& mssg_de = use_facet<messages<char> >(loc_de); 
  
!   catalog cat_de = mssg_de.open("libstdc++", loc_de, dir);
    string s01 = mssg_de.get(cat_de, 0, 0, "please");
    string s02 = mssg_de.get(cat_de, 0, 0, "thank you");
!   cout << "please in german:" << s01 << '\n';
!   cout << "thank you in german:" << s02 << '\n';
    mssg_de.close(cat_de);
  }
  </pre>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]