#include <iostream>
#include <sstream>
-#include "zypp/base/Gettext.h"
-#include "zypp/base/LogTools.h"
-#include "zypp/base/Algorithm.h"
-#include "zypp/base/String.h"
-#include "zypp/repo/RepoException.h"
-#include "zypp/RelCompare.h"
+#include <zypp/base/Gettext.h>
+#include <zypp/base/LogTools.h>
+#include <zypp/base/Algorithm.h>
+#include <zypp/base/String.h>
+#include <zypp/repo/RepoException.h>
+#include <zypp/RelCompare.h>
-#include "zypp/sat/Pool.h"
-#include "zypp/sat/Solvable.h"
-#include "zypp/base/StrMatcher.h"
+#include <zypp/sat/Pool.h>
+#include <zypp/sat/Solvable.h>
+#include <zypp/base/StrMatcher.h>
-#include "zypp/PoolQuery.h"
+#include <zypp/PoolQuery.h>
#undef ZYPP_BASE_LOGGER_LOGGROUP
#define ZYPP_BASE_LOGGER_LOGGROUP "PoolQuery"
-using namespace std;
+using std::endl;
using namespace zypp::sat;
///////////////////////////////////////////////////////////////////
public:
/** String representation */
- string asString() const;
+ std::string asString() const;
/** \name Raw query options. */
//@{
{
MyInserter(PoolQuery::StrContainer & cont) : _cont(cont) {}
- bool operator()(const string & str)
+ bool operator()(const std::string & str)
{
_cont.insert(str);
return true;
struct EmptyFilter
{
- bool operator()(const string & str)
+ bool operator()(const std::string & str)
{
return !str.empty();
}
return StrMatcher( ret, retflags );
}
- string PoolQuery::Impl::asString() const
+ std::string PoolQuery::Impl::asString() const
{
- ostringstream o;
+ std::ostringstream o;
o << "kinds: ";
if ( _kinds.empty() )
void PoolQuery::addKind(const ResKind & kind)
{ _pimpl->_kinds.insert(kind); }
- void PoolQuery::addString(const string & value)
+ void PoolQuery::addString(const std::string & value)
{ _pimpl->_strings.insert(value); }
void PoolQuery::addAttribute(const sat::SolvAttr & attr, const std::string & value)
//\TODO maybe ctor with stream can be usefull
//\TODO let it throw, let it throw, let it throw.
- bool PoolQuery::recover( istream &str, char delim )
+ bool PoolQuery::recover( std::istream &str, char delim )
{
bool finded_something = false; //indicates some atributes is finded
- string s;
+ std::string s;
do {
if ( str.eof() )
break;
continue;
}
- string::size_type pos = s.find(':');
+ std::string::size_type pos = s.find(':');
if (s.empty() || pos == s.npos) // some garbage on line... act like blank line
{
if (finded_something) //is first blank line after record?
finded_something = true;
- string attrName(str::trim(string(s,0,pos))); // trimmed name of atribute
- string attrValue(str::trim(string(s,pos+1,s.npos))); //trimmed value
+ std::string attrName(str::trim(std::string(s,0,pos))); // trimmed name of atribute
+ std::string attrValue(str::trim(std::string(s,pos+1,s.npos))); //trimmed value
PoolQueryAttr attribute( attrName );
}
else if ( attribute == PoolQueryAttr::editionAttr)
{
- string::size_type pos;
+ std::string::size_type pos;
Rel rel("==");
if (attrValue.find_first_of("=<>!") == 0)
{
}
else
{
- string s = attrName;
+ std::string s = attrName;
str::replaceAll( s,"_",":" );
SolvAttr a(s);
if ( a == SolvAttr::name || isDependencyAttribute( a ) )
return finded_something;
}
- void PoolQuery::serialize( ostream &str, char delim ) const
+ void PoolQuery::serialize( std::ostream &str, char delim ) const
{
//separating delim
str << delim;
for_( it, attributes().begin(), attributes().end() )
{
- string s = it->first.asString();
+ std::string s = it->first.asString();
str::replaceAll(s,":","_");
for_( it2,it->second.begin(),it->second.end() )
{
str << delim;
}
- string PoolQuery::asString() const
+ std::string PoolQuery::asString() const
{ return _pimpl->asString(); }
- ostream & operator<<( ostream & str, const PoolQuery & obj )
+ std::ostream & operator<<( std::ostream & str, const PoolQuery & obj )
{ return str << obj.asString(); }
std::ostream & dumpOn( std::ostream & str, const PoolQuery & obj )