test/Makefile \
test/genclass \
zypp/Makefile \
- zypp/base/Makefile
+ zypp/base/Makefile \
+ zypp/detail/Makefile
)
dnl ==================================================
#include <zypp/base/Logger.h>
#include <zypp/base/String.h>
-using namespace std;
-using __gnu_cxx::hash_set;
-
-/******************************************************************
-**
-*/
-inline void memusage()
-{
- system( zypp::base::string::form( "ps v %d", getpid() ).c_str() );
-}
-
-/******************************************************************
-**
-*/
-struct StringHashFnc
+namespace zypp
{
- size_t operator()( const string & str ) const
+ namespace base
{
- unsigned long __h = 0;
- for ( const char* __s = str.c_str(); *__s; ++__s)
- __h = 5*__h + *__s;
+ class StringVal
+ {
+ public:
+ operator const std::string &() const
+ { return _value; }
+ protected:
+ StringVal()
+ {}
+ explicit
+ StringVal( const std::string & rhs )
+ : _value( rhs )
+ {}
+ StringVal( const StringVal & rhs )
+ : _value( rhs._value )
+ {}
+ ~StringVal()
+ {}
+ const StringVal & operator=( const std::string & rhs )
+ { _value = rhs; return *this; }
+ const StringVal & operator=( const StringVal & rhs )
+ { _value = rhs._value; return *this; }
+ private:
+ std::string _value;
+ };
+
+ inline std::ostream & operator<<( std::ostream & str, const StringVal & obj )
+ { return str << static_cast<const std::string &>(obj); }
- return size_t(__h);
- //return str.size();
}
-};
-/******************************************************************
-**
-*/
-template<typename Cont>
- struct lookupKey
+ class ResKind : public base::StringVal
{
- const Cont & _cont;
- lookupKey( const Cont & cont )
- : _cont( cont )
+ public:
+ ResKind()
+ {}
+ explicit
+ ResKind( const std::string & rhs )
+ : base::StringVal( rhs )
+ {}
+ ResKind( const ResKind & rhs )
+ : base::StringVal( rhs )
+ {}
+ ~ResKind()
{}
- void operator()( const string & key ) const
- {
- typename Cont::const_iterator it = _cont.find( key );
- }
};
-
-template<typename Cont>
- struct lookupNoKey
+ class ResName : public base::StringVal
{
- const Cont & _cont;
- lookupNoKey( const Cont & cont )
- : _cont( cont )
+ public:
+ ResName()
+ {}
+ explicit
+ ResName( const std::string & rhs )
+ : base::StringVal( rhs )
+ {}
+ ResName( const ResName & rhs )
+ : base::StringVal( rhs )
+ {}
+ ~ResName()
{}
- void operator()( const string & key )
- {
- typename Cont::const_iterator it = _cont.find( key+'x' );
- }
};
-
-template<typename Cont>
- void lookup( const Cont & unames )
+ class ResEdition
{
- for ( unsigned i = 0; i < 1000; ++i ) {
- for_each( unames.begin(), unames.end(), lookupKey<Cont>( unames ) );
- for_each( unames.begin(), unames.end(), lookupNoKey<Cont>( unames ) );
- }
- }
+ public:
+ typedef unsigned epoch_t;
+ ResEdition()
+ {}
+ ResEdition( const ResEdition & rhs )
+ {}
+ ~ResEdition()
+ {}
+ public:
+ epoch_t epoch() const
+ { return 0; }
+ const std::string & version() const
+ { return std::string(); }
+ const std::string & release() const
+ { return std::string(); }
+ private:
-template<typename Cont>
- void lookupTest( const vector<string> & names )
+ };
+ class ResArch : public base::StringVal
{
- Cont unames( names.begin(), names.end() );
- MIL << "Unique names: " << unames.size() << endl;
- lookup( unames );
- }
+ public:
+ ResArch()
+ {}
+ explicit
+ ResArch( const std::string & rhs )
+ : base::StringVal( rhs )
+ {}
+ ResArch( const ResArch & rhs )
+ : base::StringVal( rhs )
+ {}
+ ~ResArch()
+ {}
+ };
+
+}
+
+using namespace std;
+using namespace zypp;
+
+void tt ( const string & s )
+{
+ string t( s );
+ t = string();
+}
/******************************************************************
**
{
INT << "===[START]==========================================" << endl;
- ifstream f( "./NameList" );
- vector<string> names( (istream_iterator<string>(f)), istream_iterator<string>() );
- MIL << "Total names: " << names.size() << endl;
- memusage();
+ ResKind a( "fool" );
+ ResName b;
+ DBG << a << endl;
+ DBG << b << endl;
+
+ //b=a;
- INT << ">===[lookupTest<set<string> >]" << endl;
- lookupTest<set<string> >( names );
- memusage();
+ DBG << a << endl;
+ DBG << b << endl;
- INT << ">===[lookupTest<hash_set<string> >]" << endl;
- lookupTest<hash_set<string,StringHashFnc> >( names );
- memusage();
+ tt( a );
+ tt( b );
INT << "===[END]============================================" << endl;
return 0;
## Process this file with automake to produce Makefile.in
## ##################################################
-SUBDIRS = base
+SUBDIRS = base detail
## ##################################################
-include_HEADERS =
+include_HEADERS = \
+ ResKind.h \
+ ResName.h \
+ ResArch.h \
+ ResEdition.h
## ##################################################
## ##################################################
-lib@PACKAGE@_la_SOURCES =
+lib@PACKAGE@_la_SOURCES = \
+ ResKind.cc \
+ ResName.cc \
+ ResArch.cc \
+ ResEdition.cc
lib@PACKAGE@_la_LDFLAGS = @LIB_VERSION_INFO@
-lib@PACKAGE@_la_LIBADD = base/lib@PACKAGE@_base.la
+lib@PACKAGE@_la_LIBADD = base/lib@PACKAGE@_base.la \
+ detail/lib@PACKAGE@_detail.la
## ##################################################
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/ResArch.cc
+
+ \brief .
+
+*/
+#include <iostream>
+
+#include "zypp/ResArch.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResArch::ResArch
+ // METHOD TYPE : Ctor
+ //
+ ResArch::ResArch()
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResArch::ResArch
+ // METHOD TYPE : Ctor
+ //
+ ResArch::ResArch( const std::string & rhs )
+ : base::StringVal( rhs )
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResArch::ResArch
+ // METHOD TYPE : Ctor
+ //
+ ResArch::ResArch( const ResArch & rhs )
+ : base::StringVal( rhs )
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResArch::~ResArch
+ // METHOD TYPE : Dtor
+ //
+ ResArch::~ResArch()
+ {}
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/ResArch.h
+
+ \brief .
+
+*/
+#ifndef ZYPP_RESARCH_H
+#define ZYPP_RESARCH_H
+
+#include <iosfwd>
+
+#include "zypp/base/StringVal.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ResArch
+ //
+ /** */
+ class ResArch : public base::StringVal
+ {
+ public:
+ /** Default ctor */
+ ResArch();
+ /** */
+ explicit
+ ResArch( const std::string & rhs );
+ /** */
+ ResArch( const ResArch & rhs );
+ /** Dtor */
+ ~ResArch();
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_RESARCH_H
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/ResEdition.cc
+
+ \brief .
+
+*/
+#include <iostream>
+
+#include "zypp/base/Logger.h"
+#include "zypp/ResEdition.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ResEdition::Impl
+ //
+ /** ResEdition implementation */
+ struct ResEdition::Impl
+ {
+ /** Default ctor*/
+ Impl()
+ : _epoch( 0 )
+ {}
+
+ Impl( const std::string & version_r,
+ const std::string & release_r,
+ epoch_t epoch_r )
+ : _epoch( epoch_r )
+ , _version( version_r )
+ , _release( release_r )
+ {}
+
+ /** Dtor */
+ ~Impl()
+ {}
+
+ epoch_t _epoch;
+ std::string _version;
+ std::string _release;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ResEdition
+ //
+ ///////////////////////////////////////////////////////////////////
+
+ ResEdition::ResEdition()
+ : _pimpl( new Impl )
+ {}
+
+ ResEdition::ResEdition( const std::string & version_r,
+ const std::string & release_r,
+ epoch_t epoch_r )
+ : _pimpl( new Impl( version_r, release_r, epoch_r ) )
+ {}
+
+ ResEdition::~ResEdition()
+ {}
+
+ ResEdition::epoch_t ResEdition::epoch() const
+ { return _pimpl->_epoch; }
+
+ const std::string & ResEdition::version() const
+ { return _pimpl->_version; }
+
+ const std::string & ResEdition::release() const
+ { return _pimpl->_release; }
+
+ /******************************************************************
+ **
+ ** FUNCTION NAME : operator<<
+ ** FUNCTION TYPE : std::ostream &
+ */
+ std::ostream & operator<<( std::ostream & str, const ResEdition & obj )
+ {
+ return str << obj.version() << '-' << obj.release();
+ }
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/ResEdition.h
+
+ \brief .
+
+*/
+#ifndef ZYPP_RESEDITION_H
+#define ZYPP_RESEDITION_H
+
+#include <iosfwd>
+#include <string>
+
+#include "zypp/base/PtrTypes.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ResEdition
+ //
+ /** */
+ class ResEdition
+ {
+ public:
+ typedef unsigned epoch_t;
+ public:
+ /** Default ctor */
+ ResEdition();
+ /** */
+ ResEdition( const std::string & version_r,
+ const std::string & release_r,
+ epoch_t epoch = 0 );
+ /** Dtor */
+ ~ResEdition();
+ public:
+ /** */
+ epoch_t epoch() const;
+ /** */
+ const std::string & version() const;
+ /** */
+ const std::string & release() const;
+ private:
+ /** Hides implementation */
+ struct Impl;
+ /** Pointer to implementation */
+ base::shared_ptr<Impl> _pimpl;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /** \relates ResEdition Stream output */
+ extern std::ostream & operator<<( std::ostream & str, const ResEdition & obj );
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_RESEDITION_H
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/ResKind.cc
+
+ \brief .
+
+*/
+#include <iostream>
+
+#include "zypp/ResKind.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResKind::ResKind
+ // METHOD TYPE : Ctor
+ //
+ ResKind::ResKind()
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResKind::ResKind
+ // METHOD TYPE : Ctor
+ //
+ ResKind::ResKind( const std::string & rhs )
+ : base::StringVal( rhs )
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResKind::ResKind
+ // METHOD TYPE : Ctor
+ //
+ ResKind::ResKind( const ResKind & rhs )
+ : base::StringVal( rhs )
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResKind::~ResKind
+ // METHOD TYPE : Dtor
+ //
+ ResKind::~ResKind()
+ {}
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/ResKind.h
+
+ \brief .
+
+*/
+#ifndef ZYPP_RESKIND_H
+#define ZYPP_RESKIND_H
+
+#include <iosfwd>
+
+#include "zypp/base/StringVal.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ResKind
+ //
+ /** */
+ class ResKind : public base::StringVal
+ {
+ public:
+ /** Default ctor */
+ ResKind();
+ /** */
+ explicit
+ ResKind( const std::string & rhs );
+ /** */
+ ResKind( const ResKind & rhs );
+ /** Dtor */
+ ~ResKind();
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_RESKIND_H
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/ResName.cc
+
+ \brief .
+
+*/
+#include <iostream>
+
+#include "zypp/ResName.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResName::ResName
+ // METHOD TYPE : Ctor
+ //
+ ResName::ResName()
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResName::ResName
+ // METHOD TYPE : Ctor
+ //
+ ResName::ResName( const std::string & rhs )
+ : base::StringVal( rhs )
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResName::ResName
+ // METHOD TYPE : Ctor
+ //
+ ResName::ResName( const ResName & rhs )
+ : base::StringVal( rhs )
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResName::~ResName
+ // METHOD TYPE : Dtor
+ //
+ ResName::~ResName()
+ {}
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/ResName.h
+
+ \brief .
+
+*/
+#ifndef ZYPP_RESNAME_H
+#define ZYPP_RESNAME_H
+
+#include <iosfwd>
+
+#include "zypp/base/StringVal.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ResName
+ //
+ /** */
+ class ResName : public base::StringVal
+ {
+ public:
+ /** Default ctor */
+ ResName();
+ /** */
+ explicit
+ ResName( const std::string & rhs );
+ /** */
+ ResName( const ResName & rhs );
+ /** Dtor */
+ ~ResName();
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_RESNAME_H
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/Resolvable.cc
+
+ \brief .
+
+*/
+#include <iostream>
+
+#include "zypp/base/Logger.h"
+#include "zypp/Resolvable.h"
+#include "zypp/detailResolvableImpl.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : Resolvable::Resolvable
+ // METHOD TYPE : Ctor
+ //
+ Resolvable::Resolvable()
+ : _pimpl( new ResolvableImpl )
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : Resolvable::~Resolvable
+ // METHOD TYPE : Dtor
+ //
+ Resolvable::~Resolvable()
+ {}
+
+ const ResKind & Resolvable::kind() const
+ { return _pimpl->kind(); }
+ const ResName & Resolvable::name() const
+ { return _pimpl->name(); }
+ const ResEdition & Resolvable::edition() const
+ { return _pimpl->edition(); }
+ const ResArch & Resolvable::arch() const
+ { return _pimpl->arch(); }
+
+ /******************************************************************
+ **
+ ** FUNCTION NAME : operator<<
+ ** FUNCTION TYPE : std::ostream &
+ */
+ std::ostream & operator<<( std::ostream & str, const Resolvable & obj )
+ {
+ return str;
+ }
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/Resolvable.h
+
+ \brief .
+
+*/
+#ifndef ZYPP_RESOLVABLE_H
+#define ZYPP_RESOLVABLE_H
+
+#include <iosfwd>
+
+#include "zypp/base/PtrTypes.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ class ResKind;
+ class ResName;
+ class ResEdition;
+ class ResArch;
+
+ ///////////////////////////////////////////////////////////////////
+ namespace detail
+ { /////////////////////////////////////////////////////////////////
+ /** Hides implementation */
+ class ResolvableImpl;
+ /////////////////////////////////////////////////////////////////
+ } // namespace detail
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : Resolvable
+ //
+ /** */
+ class Resolvable
+ {
+ public:
+ /** Default ctor */
+ Resolvable();
+ /** Dtor */
+ ~Resolvable();
+ public:
+ /** */
+ const ResKind & kind() const;
+ /** */
+ const ResName & name() const;
+ /** */
+ const ResEdition & edition() const;
+ /** */
+ const ResArch & arch() const;
+
+ private:
+ /** Pointer to implementation */
+ base::shared_ptr<detail::ResolvableImpl> _pimpl;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /** \relates Resolvable Stream output */
+ extern std::ostream & operator<<( std::ostream & str, const Resolvable & obj );
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_RESOLVABLE_H
## ##################################################
include_HEADERS = \
+ PtrTypes.h \
String.h \
- Logger.h
+ Logger.h \
+ StringVal.h
noinst_LTLIBRARIES = lib@PACKAGE@_base.la
lib@PACKAGE@_base_la_SOURCES = \
String.cc \
- Logger.cc
+ Logger.cc \
+ StringVal.cc
## ##################################################
--- /dev/null
+#ifndef ZYPP_BASE_PTRTYPES_H
+#define ZYPP_BASE_PTRTYPES_H
+
+#include <boost/scoped_ptr.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/weak_ptr.hpp>
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace base
+ { /////////////////////////////////////////////////////////////////
+
+ /** */
+ using boost::scoped_ptr;
+
+ /** */
+ using boost::shared_ptr;
+
+ /** */
+ using boost::weak_ptr;
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace base
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_BASE_PTRTYPES_H
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/base/StringVal.cc
+
+ \brief .
+
+*/
+#include "zypp/base/StringVal.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace base
+ { /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : StringVal::StringVal
+ // METHOD TYPE : Ctor
+ //
+ StringVal::StringVal()
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : StringVal::StringVal
+ // METHOD TYPE : Ctor
+ //
+ StringVal::StringVal( const std::string & rhs )
+ : _value( rhs )
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : StringVal::StringVal
+ // METHOD TYPE : Ctor
+ //
+ StringVal::StringVal( const StringVal & rhs )
+ : _value( rhs._value )
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : StringVal::~StringVal
+ // METHOD TYPE : Dtor
+ //
+ StringVal::~StringVal()
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : StringVal::operator=
+ // METHOD TYPE : const StringVal &
+ //
+ const StringVal & StringVal::operator=( const std::string & rhs )
+ {
+ _value = rhs;
+ return *this;
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : StringVal::operator=
+ // METHOD TYPE : const StringVal &
+ //
+ const StringVal & StringVal::operator=( const StringVal & rhs )
+ {
+ _value = rhs._value;
+ return *this;
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace base
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/base/StringVal.h
+
+ \brief .
+
+*/
+#ifndef ZYPP_BASE_STRINGVAL_H
+#define ZYPP_BASE_STRINGVAL_H
+
+#include <iosfwd>
+#include <string>
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace base
+ { /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : StringVal
+ //
+ /** */
+ class StringVal
+ {
+ public:
+ operator const std::string &() const
+ { return _value; }
+ protected:
+ /** */
+ StringVal();
+ /** */
+ explicit
+ StringVal( const std::string & rhs );
+ /** */
+ StringVal( const StringVal & rhs );
+ /** */
+ ~StringVal();
+ /** */
+ const StringVal & operator=( const std::string & rhs );
+ /** */
+ const StringVal & operator=( const StringVal & rhs );
+ private:
+ std::string _value;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ inline std::ostream & operator<<( std::ostream & str, const StringVal & obj )
+ { return str << static_cast<const std::string &>(obj); }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace base
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_BASE_STRINGVAL_H
--- /dev/null
+Makefile.in
+Makefile
+.deps
+.libs
+*.o
+*.lo
+*.a
+*.la
--- /dev/null
+## Process this file with automake to produce Makefile.in
+## ##################################################
+
+SUBDIRS =
+
+## ##################################################
+
+include_HEADERS = \
+ ResolvableImpl.h
+
+
+noinst_LTLIBRARIES = lib@PACKAGE@_detail.la
+
+## ##################################################
+
+lib@PACKAGE@_detail_la_SOURCES = \
+ ResolvableImpl.cc
+
+## ##################################################
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/detail/ResolvableImpl.cc
+
+ \brief .
+
+*/
+#include <iostream>
+
+#include "zypp/base/Logger.h"
+#include "zypp/detail/ResolvableImpl.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace detail
+ { /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResolvableImpl::ResolvableImpl
+ // METHOD TYPE : Ctor
+ //
+ ResolvableImpl::ResolvableImpl()
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : ResolvableImpl::~ResolvableImpl
+ // METHOD TYPE : Dtor
+ //
+ ResolvableImpl::~ResolvableImpl()
+ {}
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace detail
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/**
+ \file zypp/detail/ResolvableImpl.h
+
+ \brief .
+
+*/
+#ifndef ZYPP_DETAIL_RESOLVABLEIMPL_H
+#define ZYPP_DETAIL_RESOLVABLEIMPL_H
+
+#include <iosfwd>
+
+#include "zypp/ResKind.h"
+#include "zypp/ResName.h"
+#include "zypp/ResEdition.h"
+#include "zypp/ResArch.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace detail
+ { /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ResolvableImpl
+ //
+ /** */
+ class ResolvableImpl
+ {
+ public:
+ /** Default ctor */
+ ResolvableImpl();
+
+ /** Dtor */
+ ~ResolvableImpl();
+
+ public:
+ /** */
+ const ResKind & kind() const
+ { return _kind; }
+ /** */
+ const ResName & name() const
+ { return _name; }
+ /** */
+ const ResEdition & edition() const
+ { return _edition; }
+ /** */
+ const ResArch & arch() const
+ { return _arch; }
+
+ private:
+ ResKind _kind;
+ ResName _name;
+ ResEdition _edition;
+ ResArch _arch;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace detail
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_DETAIL_RESOLVABLEIMPL_H