OSDN Git Service

2002-01-30 Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Jan 2002 00:24:56 +0000 (00:24 +0000)
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Jan 2002 00:24:56 +0000 (00:24 +0000)
* docs/html/22_locale/messages.html: Fix example code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49349 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/docs/html/22_locale/messages.html

index 117b122..cb3f92b 100644 (file)
@@ -1,3 +1,7 @@
+2002-01-30  Peter Schmid  <schmid@snake.iap.physik.tu-darmstadt.de>
+
+       * docs/html/22_locale/messages.html: Fix example code.
+
 2002-01-30  Richard Henderson  <rth@redhat.com>
 
        * testsuite/27_io/ostream_inserter_arith.cc (test03_check): Break
index 6888c72..371371f 100644 (file)
@@ -251,26 +251,23 @@ documentation. Here's an idea of what is required:
        <li> message converting, simple example using the GNU model.
 
 <pre>
+#include <iostream>
 #include <locale>
+using namespace std;
 
 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.
+  typedef messages<char>::catalog catalog;
+  const char* dir =
+  "/mnt/egcs/build/i686-pc-linux-gnu/libstdc++-v3/po/share/locale";  
+  const locale loc_de("de_DE");
   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);
+  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");
-  // s01 == "bitte" 
-  // s02 == "danke" 
+  cout << "please in german:" << s01 << '\n';
+  cout << "thank you in german:" << s02 << '\n';
   mssg_de.close(cat_de);
 }
 </pre>