stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elemi...@apache.org
Subject svn commit: r654588 - /stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp
Date Thu, 08 May 2008 17:49:10 GMT
Author: elemings
Date: Thu May  8 10:48:37 2008
New Revision: 654588

URL: http://svn.apache.org/viewvc?rev=654588&view=rev
Log:
2008-05-08  Eric Lemings <eric.lemings@roguewave.com>

	STDCXX-905
	* branches/4.2.x/tests/localization/22.locale.synopsis.cpp:
	Added collate class template specialization for UDC type (just
	prior to CollateDerived class template) to define protected
	virtual functions expected by test cases.


Modified:
    stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp

Modified: stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp
URL: http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp?rev=654588&r1=654587&r2=654588&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp (original)
+++ stdcxx/branches/4.2.x/tests/localization/22.locale.synopsis.cpp Thu May  8 10:48:37 2008
@@ -1342,6 +1342,53 @@
 
 // collate category
 
+_RWSTD_NAMESPACE (std) {
+
+// class template specialization for UDC type
+_RWSTD_SPECIALIZED_CLASS
+struct collate<UDC>: locale::facet
+{
+    typedef UDC                 char_type;
+    typedef basic_string<UDC>   string_type;
+
+    static locale::id           id;
+
+    int
+    compare (const char_type* begin1, const char_type* end1,
+             const char_type* begin2, const char_type* end2) const {
+        return do_compare (begin1, end1, begin2, end2) ;
+    }
+
+protected:
+
+    // define (no-op) virtual functions for UDC type
+    virtual int
+    do_compare (const char_type*, const char_type*,
+                const char_type*, const char_type*) const
+    {
+        return int ();
+    }
+
+    virtual string_type
+    do_transform (const char_type*, const char_type*) const
+    {
+        return string_type ();
+    }
+
+
+    virtual long
+    do_hash (const char_type*, const char_type*) const
+    {
+        return long ();
+    }
+
+};
+
+locale::id collate<UDC>::id;
+
+}   // namespace std
+
+
 template <class charT>
 struct CollateDerived: std::collate<charT>
 {



Mime
View raw message