diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-12-04 17:44:43 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-12-06 13:35:16 +0100 |
commit | 57369e6addb5d7a9cbbb1e17deb3ff7375b88353 (patch) | |
tree | e26c4d154c22fbe6a792b86dace9712f831e197d /sal | |
parent | committed by mistake (diff) | |
download | core-57369e6addb5d7a9cbbb1e17deb3ff7375b88353.tar.gz core-57369e6addb5d7a9cbbb1e17deb3ff7375b88353.zip |
reduce a bit the rtl vs rtlunittest mess in string headers
Change-Id: I27bf6d5466313a7e4a1363f481b2bd7eab142a5c
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/rtl/string.hxx | 22 | ||||
-rw-r--r-- | sal/inc/rtl/ustring.hxx | 32 |
2 files changed, 17 insertions, 37 deletions
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx index cbd4b9a1b043..2acd1e8bcdb6 100644 --- a/sal/inc/rtl/string.hxx +++ b/sal/inc/rtl/string.hxx @@ -1513,18 +1513,6 @@ inline std::basic_ostream<charT, traits> & operator <<( typedef OString OStringLiteral; #endif -} /* Namespace */ - -#ifdef RTL_STRING_UNITTEST -namespace rtl -{ -typedef rtlunittest::OString OString; -} -#undef RTL_STRING_CONST_FUNCTION -#endif - -namespace rtl -{ /** A helper to use OStrings with hash maps. @@ -1556,7 +1544,7 @@ struct OStringHash */ template< typename charT, typename traits > std::basic_ostream<charT, traits> & operator <<( - std::basic_ostream<charT, traits> & stream, rtl::OString const & string) + std::basic_ostream<charT, traits> & stream, OString const & string) { return stream << string.getStr(); // best effort; potentially loses data due to embedded null characters @@ -1564,6 +1552,14 @@ operator <<( } /* Namespace */ +#ifdef RTL_STRING_UNITTEST +namespace rtl +{ +typedef rtlunittest::OString OString; +} +#undef RTL_STRING_CONST_FUNCTION +#endif + #ifdef RTL_USING using ::rtl::OString; using ::rtl::OStringHash; diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index 36295116dbe9..ca9a9e3b6a38 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -2156,18 +2156,6 @@ inline std::basic_ostream<charT, traits> & operator <<( typedef OUString OUStringLiteral; #endif -} /* Namespace */ - -#ifdef RTL_STRING_UNITTEST -namespace rtl -{ -typedef rtlunittest::OUString OUString; -} -#endif - -namespace rtl -{ - /** A helper to use OUStrings with hash maps. Instances of this class are unary function objects that can be used as @@ -2240,17 +2228,6 @@ inline OString OUStringToOString( const OUString & rUnicode, /* ======================================================================= */ -} /* Namespace */ - -#ifdef RTL_STRING_UNITTEST -#define rtl rtlunittest -#endif -namespace rtl -{ -#ifdef RTL_STRING_UNITTEST -#undef rtl -#endif - /** Support for rtl::OUString in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO macros, for example). @@ -2264,13 +2241,20 @@ inline std::basic_ostream<charT, traits> & operator <<( std::basic_ostream<charT, traits> & stream, OUString const & string) { return stream << - rtl::OUStringToOString(string, RTL_TEXTENCODING_UTF8).getStr(); + OUStringToOString(string, RTL_TEXTENCODING_UTF8).getStr(); // best effort; potentially loses data due to conversion failures // (stray surrogate halves) and embedded null characters } } // namespace +#ifdef RTL_STRING_UNITTEST +namespace rtl +{ +typedef rtlunittest::OUString OUString; +} +#endif + // RTL_USING is defined by gbuild for all modules except those with stable public API // (as listed in ure/source/README). It allows to use classes like OUString without // having to explicitly refer to the rtl namespace, which is kind of superfluous |