Author: mlandres
Date: Fri Aug 3 13:39:23 2007
New Revision: 6422
URL: http://svn.opensuse.org/viewcvs/zypp?rev=6422&view=rev
Log:
Specialize str::asString<> for intrusive_ptr and weak_ptr. Inline
trivial str::asStringstd::string.
Modified:
trunk/libzypp/zypp/base/String.cc
trunk/libzypp/zypp/base/String.h
Modified: trunk/libzypp/zypp/base/String.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/String.cc?rev=6422&r1=6421&r2=6422&view=diff
==============================================================================
--- trunk/libzypp/zypp/base/String.cc (original)
+++ trunk/libzypp/zypp/base/String.cc Fri Aug 3 13:39:23 2007
@@ -22,12 +22,7 @@
///////////////////////////////////////////////////////////////////
namespace str
{ /////////////////////////////////////////////////////////////////
- template<>
- std::string asString( const std::string &t )
- {
- return t;
- }
-
+
/******************************************************************
**
** FUNCTION NAME : form
@@ -136,13 +131,13 @@
{
if ( ltrim_first )
line = ltrim( line );
-
+
if ( line.empty() )
return line;
-
+
std::string ret;
std::string::size_type p = line.find_first_of( " \t" );
-
+
if ( p == std::string::npos ) {
// no ws on line
ret = line;
@@ -179,15 +174,15 @@
str.getline( tmpBuff, tmpBuffLen ); // always writes '\0' terminated
ret += tmpBuff;
} while( str.rdstate() == std::ios::failbit );
-
+
return trim( ret, trim_r );
}
-
+
std::string getline( std::istream & str, const Trim trim_r )
{
return _getline(str, trim_r);
}
-
+
std::string getline( std::istream & str, bool trim )
{
return _getline(str, trim?TRIM:NO_TRIM);
@@ -199,7 +194,7 @@
{
str << "[match "<< k << "] [" << what[k] << "]" << std::endl;
}
-
+
return str;
}
/////////////////////////////////////////////////////////////////
Modified: trunk/libzypp/zypp/base/String.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/base/String.h?rev=6422&r1=6421&r2=6422&view=diff
==============================================================================
--- trunk/libzypp/zypp/base/String.h (original)
+++ trunk/libzypp/zypp/base/String.h Fri Aug 3 13:39:23 2007
@@ -16,6 +16,8 @@
#include <string>
#include