Author: mlandres
Date: Thu Jun 21 17:26:12 2007
New Revision: 5824
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5824&view=rev
Log:
Backup (Introduce CacheAttributes and start fixing the cached resolvable implementations.)
Modified:
branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc
branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h
branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc
branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc
Modified: branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/CMakeLists.txt Thu Jun 21 17:26:12 2007
@@ -874,6 +874,7 @@
${CMAKE_BINARY_DIR}/zypp/sqlite-schema.h
cache/CacheInitializer.cc
cache/CacheException.cc
+ cache/Attribute.cc
cache/CacheTypes.cc
cache/ResolvableQuery.cc
cache/CacheStore.cc
@@ -882,6 +883,8 @@
)
SET( zypp_cache_HEADERS
+ cache/Attribute.h
+ cache/CacheAttributes.h
cache/CacheTypes.h
cache/CacheInitializer.h
cache/CacheException.h
Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.cc Thu Jun 21 17:26:12 2007
@@ -10,6 +10,7 @@
#include "zypp/cache/CacheInitializer.h"
#include "zypp/cache/CacheStore.h"
#include "zypp/cache/CacheException.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp;
@@ -201,36 +202,36 @@
void CacheStore::appendResObjectAttributes( const data::RecordId &rid,
const data::ResObject_Ptr & res )
{
- appendTranslatedStringAttribute( rid, "ResObject", "description", res->description );
- appendTranslatedStringAttribute( rid, "ResObject", "summary", res->summary );
- appendNumericAttribute( rid, "ResObject", "installedSize", res->installedSize );
- appendNumericAttribute( rid, "ResObject", "buildTime", res->buildTime );
- appendBooleanAttribute( rid, "ResObject", "installOnly", res->installOnly );
- appendStringAttribute( rid, "ResObject", "vendor", res->vendor );
- appendTranslatedStringAttribute( rid, "ResObject", "licenseToConfirm", res->licenseToConfirm );
- appendTranslatedStringAttribute( rid, "ResObject", "insnotify", res->insnotify );
- appendTranslatedStringAttribute( rid, "ResObject", "delnotify", res->delnotify );
+ appendTranslatedStringAttribute( rid, attrResObjectDescription(), res->description );
+ appendTranslatedStringAttribute( rid, attrResObjectSummary(), res->summary );
+ appendNumericAttribute( rid, attrResObjectInstalledSize(), res->installedSize );
+ appendNumericAttribute( rid, attrResObjectBuildTime(), res->buildTime );
+ appendBooleanAttribute( rid, attrResObjectInstallOnly(), res->installOnly );
+ appendStringAttribute( rid, attrResObjectVendor(), res->vendor );
+ appendTranslatedStringAttribute( rid, attrResObjectLicenseToConfirm(), res->licenseToConfirm );
+ appendTranslatedStringAttribute( rid, attrResObjectInsnotify(), res->insnotify );
+ appendTranslatedStringAttribute( rid, attrResObjectDelnotify(), res->delnotify );
}
void CacheStore::appendPackageBaseAttributes( const RecordId & pkgid,
const data::Packagebase_Ptr & package )
{
- appendStringAttribute( pkgid, "Package", "checksum", package->repositoryLocation.fileChecksum.checksum() );
- appendStringAttribute( pkgid, "Package", "checksumType", package->repositoryLocation.fileChecksum.type() );
- appendStringAttribute( pkgid, "Package", "buildhost", package->buildhost );
- appendStringAttribute( pkgid, "Package", "distribution", package->distribution );
- appendStringAttribute( pkgid, "Package", "license", package->license );
- appendStringAttribute( pkgid, "Package", "group", package->packager );
- appendStringAttribute( pkgid, "Package", "url", package->url );
- appendStringAttribute( pkgid, "Package", "operatingSystem", package->operatingSystem );
- appendStringAttribute( pkgid, "Package", "prein", package->prein );
- appendStringAttribute( pkgid, "Package", "postin", package->postin );
- appendStringAttribute( pkgid, "Package", "preun", package->preun );
- appendStringAttribute( pkgid, "Package", "postun", package->postun );
- appendStringContainerAttribute( pkgid, "Package", "keywords", package->keywords.begin(), package->keywords.end() );
- appendStringContainerAttribute( pkgid, "Package", "authors", package->authors.begin(), package->authors.end() );
- appendStringAttribute( pkgid, "Package", "location", package->repositoryLocation.filePath.asString() );
+ appendStringAttribute( pkgid, attrPackageChecksum(), package->repositoryLocation.fileChecksum.checksum() );
+ appendStringAttribute( pkgid, attrPackageChecksumType(), package->repositoryLocation.fileChecksum.type() );
+ appendStringAttribute( pkgid, attrPackageBuildhost(), package->buildhost );
+ appendStringAttribute( pkgid, attrPackageDistribution(), package->distribution );
+ appendStringAttribute( pkgid, attrPackageLicense(), package->license );
+ appendStringAttribute( pkgid, attrPackageGroup(), package->packager );
+ appendStringAttribute( pkgid, attrPackageUrl(), package->url );
+ appendStringAttribute( pkgid, attrPackageOperatingSystem(), package->operatingSystem );
+ appendStringAttribute( pkgid, attrPackagePrein(), package->prein );
+ appendStringAttribute( pkgid, attrPackagePostin(), package->postin );
+ appendStringAttribute( pkgid, attrPackagePreun(), package->preun );
+ appendStringAttribute( pkgid, attrPackagePostun(), package->postun );
+ appendStringContainerAttribute( pkgid, attrPackageKeywords(), package->keywords.begin(), package->keywords.end() );
+ appendStringContainerAttribute( pkgid, attrPackageAuthors(), package->authors.begin(), package->authors.end() );
+ appendStringAttribute( pkgid, attrPackageLocation(), package->repositoryLocation.filePath.asString() );
}
RecordId CacheStore::consumePackage( const RecordId & repository_id,
@@ -264,10 +265,10 @@
appendResObjectAttributes( id, patch );
// patch attributes
- appendNumericAttribute( id, "Patch", "timestamp", patch->timestamp );
- appendStringAttribute( id, "Patch", "category", patch->category );
- appendBooleanAttribute( id, "Patch", "rebootNeeded", patch->rebootNeeded );
- appendBooleanAttribute( id, "Patch", "affectsPkgManager", patch->affectsPkgManager );
+ appendNumericAttribute( id, attrPatchTimestamp(), patch->timestamp );
+ appendStringAttribute( id, attrPatchCategory(), patch->category );
+ appendBooleanAttribute( id, attrPatchRebootNeeded(), patch->rebootNeeded );
+ appendBooleanAttribute( id, attrPatchAffectsPkgManager(), patch->affectsPkgManager );
DBG << "got patch " << patch->name << ", atoms: ";
@@ -333,7 +334,7 @@
NVRA( message->name, message->edition, message->arch ), message->deps );
appendResObjectAttributes( id, message );
- appendTranslatedStringAttribute( id, "Message", "text", message->text );
+ appendTranslatedStringAttribute( id, attrMessageText(), message->text );
return id;
}
@@ -344,14 +345,14 @@
NVRA( script->name, script->edition, script->arch ), script->deps );
appendResObjectAttributes( id, script );
- appendStringAttribute( id, "Script", "doScript", script->doScript );
- appendStringAttribute( id, "Script", "doScriptLocation", script->doScriptLocation.filePath.asString() );
- appendStringAttribute( id, "Script", "doScriptChecksum", script->doScriptLocation.fileChecksum.checksum() );
- appendStringAttribute( id, "Script", "doScriptChecksumType", script->doScriptLocation.fileChecksum.type() );
- appendStringAttribute( id, "Script", "undoScript", script->undoScript );
- appendStringAttribute( id, "Script", "undoScriptLocation", script->undoScriptLocation.filePath.asString() );
- appendStringAttribute( id, "Script", "undoScriptChecksum", script->undoScriptLocation.fileChecksum.checksum() );
- appendStringAttribute( id, "Script", "undoScriptChecksumType", script->undoScriptLocation.fileChecksum.type() );
+ appendStringAttribute( id, attrScriptDoScript(), script->doScript );
+ appendStringAttribute( id, attrScriptDoScriptLocation(), script->doScriptLocation.filePath.asString() );
+ appendStringAttribute( id, attrScriptDoScriptChecksum(), script->doScriptLocation.fileChecksum.checksum() );
+ appendStringAttribute( id, attrScriptDoScriptChecksumType(), script->doScriptLocation.fileChecksum.type() );
+ appendStringAttribute( id, attrScriptUndoScript(), script->undoScript );
+ appendStringAttribute( id, attrScriptUndoScriptLocation(), script->undoScriptLocation.filePath.asString() );
+ appendStringAttribute( id, attrScriptUndoScriptChecksum(), script->undoScriptLocation.fileChecksum.checksum() );
+ appendStringAttribute( id, attrScriptUndoScriptChecksumType(), script->undoScriptLocation.fileChecksum.type() );
return id;
}
@@ -362,11 +363,11 @@
NVRA( pattern->name, pattern->edition, pattern->arch ), pattern->deps );
appendResObjectAttributes( id, pattern );
- appendBooleanAttribute( id, "Pattern", "isDefault", pattern->isDefault );
- appendBooleanAttribute( id, "Pattern", "userVisible", pattern->userVisible );
- appendTranslatedStringAttribute( id, "Pattern", "category", pattern->category );
- appendStringAttribute( id, "Pattern", "icon", pattern->icon );
- appendStringAttribute( id, "Pattern", "order", pattern->order );
+ appendBooleanAttribute( id, attrPatternIsDefault(), pattern->isDefault );
+ appendBooleanAttribute( id, attrPatternUserVisible(), pattern->userVisible );
+ appendTranslatedStringAttribute( id, attrPatternCategory(), pattern->category );
+ appendStringAttribute( id, attrPatternIcon(), pattern->icon );
+ appendStringAttribute( id, attrPatternOrder(), pattern->order );
return id;
}
@@ -377,15 +378,15 @@
NVRA( product->name, product->edition, product->arch ), product->deps );
appendResObjectAttributes( id, product );
- appendTranslatedStringAttribute( id, "Product", "shortName", product->shortName );
- appendTranslatedStringAttribute( id, "Product", "longName", product->longName );
- appendStringContainerAttribute( id, "Product", "flags", product->flags.begin(), product->flags.end() );
- appendStringAttribute( id, "Product", "releasenotesUrl", product->releasenotesUrl.asString() );
- appendStringContainerAttribute( id, "Product", "updateUrls", product->updateUrls );
- appendStringContainerAttribute( id, "Product", "extraUrls", product->extraUrls );
- appendStringContainerAttribute( id, "Product", "optionalUrls", product->optionalUrls );
- appendStringAttribute( id, "Product", "distributionName", product->distributionName );
- appendStringAttribute( id, "Product", "distributionEdition", product->distributionEdition.asString() );
+ appendTranslatedStringAttribute( id, attrProductShortName(), product->shortName );
+ appendTranslatedStringAttribute( id, attrProductLongName(), product->longName );
+ appendStringContainerAttribute( id, attrProductFlags(), product->flags.begin(), product->flags.end() );
+ appendStringAttribute( id, attrProductReleasenotesUrl(), product->releasenotesUrl.asString() );
+ appendStringContainerAttribute( id, attrProductUpdateUrls(), product->updateUrls );
+ appendStringContainerAttribute( id, attrProductExtraUrls(), product->extraUrls );
+ appendStringContainerAttribute( id, attrProductOptionalUrls(), product->optionalUrls );
+ appendStringAttribute( id, attrProductDistributionName(), product->distributionName );
+ appendStringAttribute( id, attrProductDistributionEdition(), product->distributionEdition.asString() );
return id;
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/cache/CacheStore.h Thu Jun 21 17:26:12 2007
@@ -28,6 +28,7 @@
#include "zypp/base/PtrTypes.h"
#include "zypp/RepoStatus.h"
#include "zypp/ProgressData.h"
+#include "zypp/cache/Attribute.h"
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -385,6 +386,9 @@
*/
data::RecordId lookupOrAppendType( const std::string &klass,
const std::string &name );
+ /** \overload */
+ data::RecordId lookupOrAppendType( const Attribute &attr )
+ { return lookupOrAppendType( attr.klass, attr.name ); }
/**
* Returns the record id of a repository (Source)
@@ -426,6 +430,11 @@
const std::string &klass,
const std::string &name,
int value );
+ /** \overload */
+ void appendNumericAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ int value )
+ { appendNumericAttribute( resolvable_id, attr.klass, attr.name, value ); }
/**
* Append a translated string value to a resolvable
@@ -438,6 +447,11 @@
const std::string &klass,
const std::string &name,
const TranslatedText &text );
+ /** \overload */
+ void appendTranslatedStringAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ const TranslatedText &text )
+ { appendTranslatedStringAttribute( resolvable_id, attr.klass, attr.name, text ); }
/**
* Append a string value to a resolvable
@@ -452,6 +466,12 @@
const std::string &klass,
const std::string &name,
const std::string &text );
+ /** \overload */
+ void appendStringAttributeTranslation( const data::RecordId &resolvable_id,
+ const Locale &locale,
+ const Attribute& attr,
+ const std::string &text )
+ { appendStringAttributeTranslation( resolvable_id, locale, attr.klass, attr.name, text ); }
/**
* Append a string value to a resolvable
@@ -464,6 +484,11 @@
const std::string &klass,
const std::string &name,
const std::string &value );
+ /** \overload */
+ void appendStringAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ const std::string &value )
+ { appendStringAttribute( resolvable_id, attr.klass, attr.name, value ); }
/**
* Append a string value to a resolvable
@@ -475,7 +500,6 @@
const data::RecordId &type_id,
const std::string &value );
-
/**
* Append strings from _Iterator to a resolvable.
*
@@ -501,6 +525,13 @@
std::string value = str::join(begin, end, ZConfig().cacheDBSplitJoinSeparator());
appendStringAttribute( resolvable_id, klass, name, value );
}
+ /** \overload */
+ template <class _Iterator>
+ void appendStringContainerAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ _Iterator begin,
+ _Iterator end )
+ { appendStringContainerAttribute( resolvable_id, attr.klass, attr.name, begin, end ); }
/**
* Append strings from a _Container to a resolvable.
@@ -516,6 +547,12 @@
const std::string &name,
const _Container & container )
{ appendStringContainerAttribute( resolvable_id, klass, name, container.begin(), container.end() ); }
+ /** \overload */
+ template <class _Container>
+ void appendStringContainerAttribute( const data::RecordId &resolvable_id,
+ const Attribute& attr,
+ const _Container & container )
+ { appendStringContainerAttribute( resolvable_id, attr.klass, attr.name, container ); }
/**
* Update a known repository checksum and timestamp
@@ -676,6 +713,12 @@
const std::string & klass,
const std::string & name,
bool value);
+ /** \overload */
+ void appendBooleanAttribute( const data::RecordId & resolvable_id,
+ const Attribute& attr,
+ bool value)
+ { appendBooleanAttribute( resolvable_id, attr.klass, attr.name, value ); }
+
/** \name Detail Attributes Inserters
* These functions are used by ResolvableConsumer interface functions
Modified: branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/cache/ResolvableQuery.h Thu Jun 21 17:26:12 2007
@@ -8,6 +8,7 @@
#include "zypp/Pathname.h"
#include "zypp/data/ResolvableData.h"
#include "zypp/data/RecordId.h"
+#include "zypp/cache/Attribute.h"
///////////////////////////////////////////////////////////////////
namespace zypp
@@ -15,7 +16,7 @@
///////////////////////////////////////////////////////////////////
namespace cache
{ /////////////////////////////////////////////////////////////////
-
+
/**
* The resolvable query class allows you to query for resolvable
* data and properties from the cache.
@@ -28,16 +29,16 @@
* first parameter is the resolvable id.
* second parameter is a \ref data::ResObjectData object with the resource
*/
- typedef function ProcessResolvable;
-
+
/**
* Constructor
*
* \param dbdir Cache location path
*/
ResolvableQuery( const Pathname &dbdir );
-
+
/**
* Query by record id
* \param record_id Resolvable id to query
@@ -45,7 +46,7 @@
*/
void query( const data::RecordId &record_id,
ProcessResolvable fnc );
-
+
/**
* Query by matching text
* \param text text to match
@@ -53,7 +54,7 @@
*/
void query( const std::string &text,
ProcessResolvable fnc );
-
+
/**
* Queries a specifc attribute for a resolvable
*
@@ -68,6 +69,11 @@
const std::string &klass,
const std::string &name,
int default_value = -1 );
+ /** \overload */
+ int queryNumericAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ int default_value = -1 )
+ { return queryNumericAttribute( record_id, attr.klass, attr.name, default_value ); }
/**
@@ -84,6 +90,11 @@
const std::string &klass,
const std::string &name,
bool default_value = false );
+ /** \overload */
+ bool queryBooleanAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ bool default_value = false )
+ { return queryBooleanAttribute( record_id, attr.klass, attr.name, default_value ); }
/**
@@ -100,7 +111,12 @@
const std::string &klass,
const std::string &name,
const std::string &default_value = std::string() );
-
+ /** \overload */
+ std::string queryStringAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ const std::string &default_value = std::string() )
+ { return queryStringAttribute( record_id, attr.klass, attr.name, default_value ); }
+
/**
* Queries a specifc attribute translation
* for a resolvable.
@@ -118,7 +134,13 @@
const std::string &klass,
const std::string &name,
const std::string &default_value = std::string() );
-
+ /** \overload */
+ std::string queryStringAttributeTranslation( const data::RecordId &record_id,
+ const Locale &locale,
+ const Attribute& attr,
+ const std::string &default_value = std::string() )
+ { return queryStringAttributeTranslation( record_id, locale, attr.klass, attr.name, default_value ); }
+
/**
* Queries all translations for a specific attribute
* in a resolvable.
@@ -127,14 +149,19 @@
* \param klass Attribute Class
* \param name Attribute Name
*
- * \return all attribute translations or a empty
+ * \return all attribute translations or a empty
* \ref TranslatedString if no record is found.
*/
TranslatedText queryTranslatedStringAttribute( const data::RecordId &record_id,
const std::string &klass,
const std::string &name,
- const TranslatedText &default_vaue = TranslatedText() );
-
+ const TranslatedText &default_value = TranslatedText() );
+ /** \overload */
+ TranslatedText queryTranslatedStringAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ const TranslatedText &default_value = TranslatedText() )
+ { return queryTranslatedStringAttribute( record_id, attr.klass, attr.name, default_value ); }
+
/**
* Queries for a specific container attribute
* in a resolvable.
@@ -152,14 +179,20 @@
const std::string &name,
_OutputIterator result )
{
-
+
std::string all = queryStringAttribute( record_id, klass, name);
//FIXME use zypp separator
str::split( all, result );
}
-
-
-
+ /** \overload */
+ template<class _OutputIterator>
+ void queryStringContainerAttribute( const data::RecordId &record_id,
+ const Attribute& attr,
+ _OutputIterator result )
+ { queryStringContainerAttribute( record_id, attr.klass, attr.name, result ); }
+
+
+
private:
/** Implementation. */
class Impl;
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/AtomImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,11 +12,11 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "AtomImpl.h"
-
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp::detail;
-using namespace::zypp::repo;
+//using namespace::zypp::repo;
///////////////////////////////////////////////////////////////////
namespace zypp { namespace repo { namespace cached {
@@ -46,53 +46,52 @@
TranslatedText AtomImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText AtomImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText AtomImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText AtomImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText AtomImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor AtomImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
-
ByteCount AtomImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount AtomImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool AtomImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date AtomImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date AtomImpl::installtime() const
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/MessageImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,6 +12,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "MessageImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -46,53 +47,53 @@
TranslatedText MessageImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText MessageImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText MessageImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText MessageImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText MessageImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor MessageImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount MessageImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount MessageImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool MessageImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date MessageImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date MessageImpl::installtime() const
@@ -111,14 +112,14 @@
TranslatedText MessageImpl::text() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "Message", "text" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrMessageText() );
}
Patch::constPtr MessageImpl::patch() const
{
return 0;
}
-
+
/////////////////////////////////////////////////////////////////
} } } // namespace zypp::repo::cached
///////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PackageImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,7 +15,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "PackageImpl.h"
-
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp::detail;
@@ -49,53 +49,55 @@
TranslatedText PackageImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText PackageImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText PackageImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText PackageImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText PackageImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor PackageImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount PackageImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+#warning CHECK IF ATRIB IS MISSING IN DB
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount PackageImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+#warning CHECK IF ATRIB IS MISSING IN DB
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool PackageImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date PackageImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date PackageImpl::installtime() const
@@ -115,33 +117,35 @@
std::string PackageImpl::buildhost() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "buildhost" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageBuildhost() );
}
std::string PackageImpl::distribution() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "distribution" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageDistribution() );
}
Label PackageImpl::license() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "license" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageLicense() );
}
std::string PackageImpl::packager() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "packager" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePackager() );
}
PackageGroup PackageImpl::group() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "group" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageGroup() );
}
PackageImpl::Keywords PackageImpl::keywords() const
{
PackageImpl::Keywords keywords;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Package", "keywords", std::inserter(keywords, keywords.begin()) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrPackageKeywords(), std::inserter(keywords, keywords.begin()) );
return keywords;
}
@@ -152,37 +156,37 @@
Pathname PackageImpl::location() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "location" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageLocation() );
}
std::string PackageImpl::url() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "url" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageUrl() );
}
std::string PackageImpl::os() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "operatingSystem" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageOperatingSystem() );
}
Text PackageImpl::prein() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "prein" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePrein() );
}
Text PackageImpl::postin() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "postin" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePostin() );
}
Text PackageImpl::preun() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "preun" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePreun() );
}
Text PackageImpl::postun() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Package", "postun" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackagePostun() );
}
ByteCount PackageImpl::sourcesize() const
@@ -198,7 +202,7 @@
list<string> PackageImpl::authors() const
{
list<string> authors;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Package", "authors", back_inserter(authors) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrPackageAuthors(), back_inserter(authors) );
return authors;
}
@@ -211,7 +215,7 @@
// {
// return std::list<DeltaRpm>();
// }
-//
+//
// std::list<PatchRpm> PackageImpl::patchRpms() const
// {
// return std::list<PatchRpm>();
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatchImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,6 +15,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "PatchImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -49,53 +50,53 @@
TranslatedText PatchImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText PatchImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText PatchImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText PatchImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText PatchImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor PatchImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount PatchImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount PatchImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool PatchImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date PatchImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date PatchImpl::installtime() const
@@ -114,36 +115,41 @@
std::string PatchImpl::id() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Patch", "id" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatchId() );
}
Date PatchImpl::timestamp() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "Patch", "timestamp" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrPatchTimestamp() );
}
std::string PatchImpl::category() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Patch", "category" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatchCategory() );
}
bool PatchImpl::reboot_needed() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Patch", "rebootNeeded" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatchRebootNeeded() );
}
bool PatchImpl::affects_pkg_manager() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Patch", "affectsPkgManager" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatchAffectsPkgManager() );
}
bool PatchImpl::interactive() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Patch", "interactive" );
+#warning DUBIOUS ATTRIBUTE
+ return false;
+ //return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatchInteractive() );
}
PatchImpl::AtomList PatchImpl::all_atoms() const
{
+#warning DUBIOUS ATTRIBUTE
return PatchImpl::AtomList();
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/PatternImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,6 +15,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "PatternImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -49,53 +50,53 @@
TranslatedText PatternImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText PatternImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText PatternImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText PatternImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText PatternImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor PatternImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount PatternImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount PatternImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool PatternImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date PatternImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date PatternImpl::installtime() const
@@ -114,43 +115,45 @@
bool PatternImpl::isDefault() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Pattern", "isDefault" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatternIsDefault() );
}
bool PatternImpl::userVisible() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Pattern", "userVisible" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrPatternUserVisible() );
}
TranslatedText PatternImpl::category() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "Pattern", "isDefault" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrPatternCategory() );
}
Pathname PatternImpl::icon() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Pattern", "icon" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatternIcon() );
}
Pathname PatternImpl::script() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Pattern", "script" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatternScript() );
}
Label PatternImpl::order() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Pattern", "order" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPatternOrder() );
}
//std::setstd::string install_packages( const Locale & lang = Locale("") ) const;
// const CapSet & PatternImpl::includes() const
// {
-//
+//
// }
-//
+//
// const CapSet & PatternImpl::extends() const
// {
-//
+//
// }
/////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ProductImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,6 +12,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "ProductImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -46,53 +47,53 @@
TranslatedText ProductImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText ProductImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText ProductImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText ProductImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText ProductImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor ProductImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount ProductImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount ProductImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool ProductImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date ProductImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date ProductImpl::installtime() const
@@ -111,55 +112,59 @@
std::string ProductImpl::category() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "category" );
+#warning DUBIOUS ATTRIBUTE
+ return "";
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductCategory() );
}
Url ProductImpl::releaseNotesUrl() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "releaseNotesUrl" );
+#warning DUBIOUS ATTRIBUTE
+ return Url();
+ //return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductReleaseNotesUrl() );
}
std::list<Url> ProductImpl::updateUrls() const
{
std::list<Url> urls;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "updateUrls", back_inserter(urls) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductUpdateUrls(), back_inserter(urls) );
return urls;
}
std::list<Url> ProductImpl::extraUrls() const
{
std::list<Url> urls;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "extraUrls", back_inserter(urls) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductExtraUrls(), back_inserter(urls) );
return urls;
}
std::list<Url> ProductImpl::optionalUrls() const
{
std::list<Url> urls;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "optionalUrls", back_inserter(urls) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductOptionalUrls(), back_inserter(urls) );
return urls;
}
list<string> ProductImpl::flags() const
{
list<string> flags;
- _repository->resolvableQuery().queryStringContainerAttribute( _id, "Product", "flags", back_inserter(flags) );
+ _repository->resolvableQuery().queryStringContainerAttribute( _id, cache::attrProductFlags(), back_inserter(flags) );
return flags;
}
TranslatedText ProductImpl::shortName() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "Product", "shortName" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrProductShortName() );
}
std::string ProductImpl::distributionName() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "distributionName" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductDistributionName() );
}
Edition ProductImpl::distributionEdition() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Product", "distributionEdition" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrProductDistributionEdition() );
}
/////////////////////////////////////////////////////////////////
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/RepoImpl.cc Thu Jun 21 17:26:12 2007
@@ -31,6 +31,7 @@
#include "zypp/repo/cached/MessageImpl.h"
#include "zypp/repo/cached/ScriptImpl.h"
#include "zypp/repo/cached/AtomImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace zypp::detail;
using namespace zypp::cache;
@@ -76,7 +77,7 @@
debug::Measure m("create resolvables");
CapFactory capfactory;
try
- {
+ {
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
con.executenonquery("PRAGMA cache_size=8000;");
con.executenonquery("BEGIN;");
@@ -84,7 +85,7 @@
sqlite3_command cmd( con, "select id,name,version,release,epoch,arch,kind from resolvables where repository_id=:repository_id;");
cmd.bind(":repository_id", _repository_id);
map > nvras;
-
+
sqlite3_reader reader = cmd.executereader();
while(reader.read())
{
@@ -97,11 +98,11 @@
_type_cache.archFor(reader.getint(5)),
deps ) );
}
-
+
MIL << "Done reading resolvables nvra" << endl;
-
+
read_capabilities( con, nvras);
-
+
for ( map >::const_iterator it = nvras.begin(); it != nvras.end(); ++it )
{
if ( it->second.first == ResTraits<Package>::kind )
@@ -147,7 +148,7 @@
cerr << "Exception Occured: " << ex.what() << endl;
}
//extract_packages_from_directory( _store, thePath, selfRepositoryRef(), true );
-
+
}
static CheckSum encoded_string_to_checksum( const std::string &encoded )
@@ -166,7 +167,7 @@
void RepoImpl::createPatchAndDeltas()
{
try
- {
+ {
sqlite3_connection con((_dbdir + "zypp.db").asString().c_str());
con.executenonquery("PRAGMA cache_size=8000;");
con.executenonquery("BEGIN;");
@@ -179,14 +180,14 @@
string pp_bv_query =
"SELECT version, release, epoch "
"FROM patch_packages_baseversions WHERE patch_package_id = :patch_package_id";
-
+
string delta_query =
// 0 1 2 3 4 5 6 7 8 9 10
"SELECT id, media_nr, location, checksum, download_size, build_time, baseversion_version, baseversion_release, baseversion_epoch, baseversion_checksum, baseversion_build_time "
// 11
", baseversion_sequence_info "
"FROM delta_packages WHERE repository_id=:repository_id;";
-
+
// bind the master repo id to the query
sqlite3_command deltas_cmd( con, delta_query);
deltas_cmd.bind(":repository_id", _repository_id);
@@ -196,7 +197,7 @@
zypp::OnMediaLocation on_media;
on_media.medianr(reader.getint(1));
on_media.filename(reader.getstring(2));
-
+
string checksum_string(reader.getstring(3));
CheckSum checksum = encoded_string_to_checksum(checksum_string);
if ( checksum.empty() )
@@ -206,10 +207,10 @@
}
on_media.checksum(checksum);
on_media.downloadsize(reader.getint(4));
-
+
packagedelta::DeltaRpm::BaseVersion baseversion;
baseversion.edition( Edition(reader.getstring(6), reader.getstring(7), reader.getstring(8) ) );
-
+
checksum_string = reader.getstring(9);
checksum = encoded_string_to_checksum(checksum_string);
if ( checksum.empty() )
@@ -220,15 +221,15 @@
baseversion.checksum(checksum);
baseversion.buildtime(reader.getint(10));
baseversion.sequenceinfo(reader.getstring(11));
-
+
zypp::packagedelta::DeltaRpm delta;
delta.location( on_media );
delta.baseversion( baseversion );
delta.buildtime(reader.getint(5));
-
+
//impl->addDeltaRpm(delta);
}
-
+
// patch rpms
// bind the master package id to the query
// bind the master repo id to the query
@@ -240,11 +241,11 @@
while ( reader.read() )
{
long long patch_package_id = reader.getint64(0);
-
+
zypp::OnMediaLocation on_media;
on_media.medianr( reader.getint(1) );
on_media.filename( reader.getstring(2) );
-
+
string checksum_string(reader.getstring(3));
CheckSum checksum = encoded_string_to_checksum(checksum_string);
if ( checksum.empty() )
@@ -254,20 +255,20 @@
}
on_media.checksum(checksum);
on_media.downloadsize(reader.getint(4));
-
+
zypp::packagedelta::PatchRpm patch;
patch.location( on_media );
patch.buildtime(reader.getint(5));
-
+
pp_bv_cmd.bind( ":patch_package_id", patch_package_id );
-
+
sqlite3_reader bv_reader = pp_bv_cmd.executereader();
while (bv_reader.read())
{
packagedelta::PatchRpm::BaseVersion baseversion = packagedelta::PatchRpm::BaseVersion( bv_reader.getstring(0) , bv_reader.getstring(1), bv_reader.getint(2) );
patch.baseversion(baseversion);
}
-
+
//impl->addPatchRpm(patch);
}
}
@@ -275,7 +276,7 @@
cerr << "Exception Occured: " << ex.what() << endl;
}
}
-
+
ResolvableQuery RepoImpl::resolvableQuery()
{
return _rquery;
@@ -284,12 +285,12 @@
void RepoImpl::read_capabilities( sqlite3_connection &con, map > &nvras )
{
CapFactory capfactory;
-
-
+
+
// precompile statements
-
-
-
+
+
+
// map named_caps;
// sqlite3_command select_named_cmd( con, "select v.id, c.refers_kind, n.name, v.version, v.release, v.epoch, v.relation named_capabilities v, capabilities c, names n where v.name_id=n.id and c.id=ncc.capability_id and ncc.named_capability_id=v.id;");
// {
@@ -297,38 +298,38 @@
// sqlite3_reader reader = select_named_cmd.executereader();
// while ( reader.read() )
// {
-//
+//
// }
// }
sqlite3_command select_named_cmd( con, "select v.refers_kind, n.name, v.version, v.release, v.epoch, v.relation, v.dependency_type, v.resolvable_id from named_capabilities v, names n where v.name_id=n.id;");
sqlite3_command select_file_cmd( con, "select fc.refers_kind, dn.name, fn.name, fc.dependency_type, fc.resolvable_id from file_capabilities fc, files f, dir_names dn, file_names fn where f.id=fc.file_id and f.dir_name_id=dn.id and f.file_name_id=fn.id;");
-
+
{
debug::Measure mnc("read named capabilities");
sqlite3_reader reader = select_named_cmd.executereader();
while ( reader.read() )
{
-
+
Resolvable::Kind refer = _type_cache.kindFor(reader.getint(0));
Rel rel = _type_cache.relationFor(reader.getint(5));
-
+
data::RecordId rid = reader.getint64(7);
-
+
if ( rel == zypp::Rel::NONE )
{
capability::NamedCap *ncap = new capability::NamedCap( refer, reader.getstring(1) );
- zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(6));
- nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(ncap) ) );
+ zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(6));
+ nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(ncap) ) );
}
else
{
capability::VersionedCap *vcap = new capability::VersionedCap( refer, reader.getstring(1), /* rel */ rel, Edition( reader.getstring(2), reader.getstring(3), reader.getint(4) ) );
zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(6));
- nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(vcap) ) );
+ nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(vcap) ) );
}
}
}
-
+
{
debug::Measure mnf("read file capabilities");
sqlite3_reader reader = select_file_cmd.executereader();
@@ -338,10 +339,10 @@
capability::FileCap *fcap = new capability::FileCap( refer, reader.getstring(1) + "/" + reader.getstring(2) );
zypp::Dep deptype = _type_cache.deptypeFor(reader.getint(3));
data::RecordId rid = reader.getint64(4);
- nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(fcap) ) );
+ nvras[rid].second[deptype].insert( capfactory.fromImpl( capability::CapabilityImpl::Ptr(fcap) ) );
}
}
-
+
MIL << nvras.size() << " capabilities" << endl;
}
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/ScriptImpl.cc Thu Jun 21 17:26:12 2007
@@ -12,6 +12,7 @@
#include "zypp/base/Logger.h"
#include "zypp/repo/RepositoryImpl.h"
#include "ScriptImpl.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
@@ -46,53 +47,53 @@
TranslatedText ScriptImpl::summary() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "summary" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectSummary() );
}
TranslatedText ScriptImpl::description() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "description" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDescription() );
}
TranslatedText ScriptImpl::insnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "insnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectInsnotify() );
}
TranslatedText ScriptImpl::delnotify() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "delnotify" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectDelnotify() );
}
TranslatedText ScriptImpl::licenseToConfirm() const
{
- return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, "ResObject", "licenseToConfirm" );
+ return _repository->resolvableQuery().queryTranslatedStringAttribute( _id, cache::attrResObjectLicenseToConfirm() );
}
Vendor ScriptImpl::vendor() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "ResObject", "vendor" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrResObjectVendor() );
}
ByteCount ScriptImpl::size() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "size" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectInstalledSize() );
}
ByteCount ScriptImpl::archivesize() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "archivesize" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectArchiveSize() );
}
bool ScriptImpl::installOnly() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "ResObject", "installOnly" );
+ return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrResObjectInstallOnly() );
}
Date ScriptImpl::buildtime() const
{
- return _repository->resolvableQuery().queryNumericAttribute( _id, "ResObject", "buildtime" );
+ return _repository->resolvableQuery().queryNumericAttribute( _id, cache::attrResObjectBuildTime() );
}
Date ScriptImpl::installtime() const
@@ -111,19 +112,21 @@
Pathname ScriptImpl::do_script() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Script", "doScript" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrScriptDoScript() );
}
Pathname ScriptImpl::undo_script() const
{
- return _repository->resolvableQuery().queryStringAttribute( _id, "Script", "undoScript" );
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrScriptUndoScript() );
}
bool ScriptImpl::undo_available() const
{
- return _repository->resolvableQuery().queryBooleanAttribute( _id, "Script", "undoAvailable", false );
+#warning DUBIOUS ATTRIBUTE
+ return false;
+ //return _repository->resolvableQuery().queryBooleanAttribute( _id, cache::attrScriptUndoAvailable(), false );
}
-
+
/////////////////////////////////////////////////////////////////
} } } // namespace zypp::repo::cached
Modified: branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc?rev=5824&r1=5823&r2=5824&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/repo/cached/SrcPackageImpl.cc Thu Jun 21 17:26:12 2007
@@ -15,6 +15,7 @@
#include "zypp/TranslatedText.h"
#include "zypp/base/String.h"
#include "zypp/base/Logger.h"
+#include "zypp/cache/CacheAttributes.h"
using namespace std;
using namespace zypp::detail;
@@ -28,6 +29,7 @@
//
///////////////////////////////////////////////////////////////////
+#warning STILL A DUMMY IMPLEMENTATION
/** Default ctor
*/
SrcPackageImpl::SrcPackageImpl (Repository repo)
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org