zypp::cache::ResolvableQuery Struct Reference

The resolvable query class allows you to query for resolvable data and properties from the cache. More...

#include <ResolvableQuery.h>

List of all members.

Public Member Functions

 ResolvableQuery (const Pathname &dbdir)
 Constructor.
 ~ResolvableQuery ()
void query (const data::RecordId &record_id, ProcessResolvable fnc)
 Query by record id.
void query (const std::string &text, ProcessResolvable fnc)
 Query by matching text.
int queryNumericAttribute (const data::RecordId &record_id, const std::string &klass, const std::string &name, int default_value=0)
 Queries a specifc attribute for a resolvable.
int queryNumericAttribute (const data::RecordId &record_id, const Attribute &attr, int default_value=0)
bool queryBooleanAttribute (const data::RecordId &record_id, const std::string &klass, const std::string &name, bool default_value=false)
 Queries a specifc attribute for a resolvable.
bool queryBooleanAttribute (const data::RecordId &record_id, const Attribute &attr, bool default_value=false)
std::string queryStringAttribute (const data::RecordId &record_id, const std::string &klass, const std::string &name, const std::string &default_value=std::string())
 Queries a specifc attribute for a resolvable.
std::string queryStringAttribute (const data::RecordId &record_id, const Attribute &attr, const std::string &default_value=std::string())
std::string queryStringAttributeTranslation (const data::RecordId &record_id, const Locale &locale, const std::string &klass, const std::string &name, const std::string &default_value=std::string())
 Queries a specifc attribute translation for a resolvable.
std::string queryStringAttributeTranslation (const data::RecordId &record_id, const Locale &locale, const Attribute &attr, const std::string &default_value=std::string())
TranslatedText queryTranslatedStringAttribute (const data::RecordId &record_id, const std::string &klass, const std::string &name, const TranslatedText &default_value=TranslatedText())
 Queries all translations for a specific attribute in a resolvable.
TranslatedText queryTranslatedStringAttribute (const data::RecordId &record_id, const Attribute &attr, const TranslatedText &default_value=TranslatedText())
template<class _OutputIterator>
void queryStringContainerAttribute (const data::RecordId &record_id, const std::string &klass, const std::string &name, _OutputIterator result)
 Queries for a specific container attribute in a resolvable.
template<class _OutputIterator>
void queryStringContainerAttribute (const data::RecordId &record_id, const Attribute &attr, _OutputIterator result)
void queryDiskUsage (const data::RecordId &record_id, DiskUsage &du)
std::string queryRepositoryAlias (const data::RecordId &repo_id)
data::RecordId queryRepositoryId (const std::string &repo_alias)
void iterateResolvablesByKindsAndStringsAndRepos (const std::vector< zypp::Resolvable::Kind > &kinds, const std::vector< std::string > &names, int flags, const std::vector< std::string > &repos, ProcessResolvable fnc)

Private Attributes

RW_pointer< Impl_pimpl
 Pointer to implementation.

Classes

struct  Impl


Detailed Description

The resolvable query class allows you to query for resolvable data and properties from the cache.

Definition at line 69 of file ResolvableQuery.h.


Constructor & Destructor Documentation

zypp::cache::ResolvableQuery::ResolvableQuery ( const Pathname &  dbdir  ) 

Constructor.

Parameters:
dbdir Cache location path

Definition at line 439 of file ResolvableQuery.cc.

zypp::cache::ResolvableQuery::~ResolvableQuery (  ) 

Definition at line 445 of file ResolvableQuery.cc.


Member Function Documentation

void zypp::cache::ResolvableQuery::query ( const data::RecordId record_id,
ProcessResolvable  fnc 
)

Query by record id.

Parameters:
record_id Resolvable id to query
fnc callback to send the data to. (Will be called once or none)

Definition at line 452 of file ResolvableQuery.cc.

References _pimpl.

void zypp::cache::ResolvableQuery::query ( const std::string &  text,
ProcessResolvable  fnc 
)

Query by matching text.

Parameters:
text text to match, wildcard operators like * and ? are allowed
fnc callback to send the data to. (Will be called once per result)

Definition at line 459 of file ResolvableQuery.cc.

References _pimpl.

int zypp::cache::ResolvableQuery::queryNumericAttribute ( const data::RecordId record_id,
const std::string &  klass,
const std::string &  name,
int  default_value = 0 
)

Queries a specifc attribute for a resolvable.

Parameters:
record_id Resolvable cache id
klass Attribute Class
name Attribute Name
Returns:
The attribute or 0 if no record is found.

Definition at line 466 of file ResolvableQuery.cc.

References _pimpl.

Referenced by queryNumericAttribute().

int zypp::cache::ResolvableQuery::queryNumericAttribute ( const data::RecordId record_id,
const Attribute attr,
int  default_value = 0 
) [inline]

Definition at line 111 of file ResolvableQuery.h.

References zypp::cache::Attribute::klass, zypp::cache::Attribute::name, and queryNumericAttribute().

bool zypp::cache::ResolvableQuery::queryBooleanAttribute ( const data::RecordId record_id,
const std::string &  klass,
const std::string &  name,
bool  default_value = false 
)

Queries a specifc attribute for a resolvable.

Parameters:
record_id Resolvable cache id
klass Attribute Class
name Attribute Name
Returns:
The bool value of the attribute or false if no record is found.

Definition at line 474 of file ResolvableQuery.cc.

References _pimpl.

Referenced by queryBooleanAttribute().

bool zypp::cache::ResolvableQuery::queryBooleanAttribute ( const data::RecordId record_id,
const Attribute attr,
bool  default_value = false 
) [inline]

Definition at line 132 of file ResolvableQuery.h.

References zypp::cache::Attribute::klass, zypp::cache::Attribute::name, and queryBooleanAttribute().

std::string zypp::cache::ResolvableQuery::queryStringAttribute ( const data::RecordId record_id,
const std::string &  klass,
const std::string &  name,
const std::string &  default_value = std::string() 
)

Queries a specifc attribute for a resolvable.

Parameters:
record_id Resolvable cache id
klass Attribute Class
name Attribute Name
Returns:
The attribute or a empty string if no record is found.

Definition at line 483 of file ResolvableQuery.cc.

References _pimpl.

Referenced by queryStringAttribute(), and queryStringContainerAttribute().

std::string zypp::cache::ResolvableQuery::queryStringAttribute ( const data::RecordId record_id,
const Attribute attr,
const std::string &  default_value = std::string() 
) [inline]

Definition at line 153 of file ResolvableQuery.h.

References zypp::cache::Attribute::klass, zypp::cache::Attribute::name, and queryStringAttribute().

std::string zypp::cache::ResolvableQuery::queryStringAttributeTranslation ( const data::RecordId record_id,
const Locale locale,
const std::string &  klass,
const std::string &  name,
const std::string &  default_value = std::string() 
)

Queries a specifc attribute translation for a resolvable.

Parameters:
record_id Resolvable cache id
locale Locale of the translation
klass Attribute Class
name Attribute Name
Returns:
The attribute or a empty string if no record is found.

Definition at line 493 of file ResolvableQuery.cc.

References _pimpl.

Referenced by queryStringAttributeTranslation().

std::string zypp::cache::ResolvableQuery::queryStringAttributeTranslation ( const data::RecordId record_id,
const Locale locale,
const Attribute attr,
const std::string &  default_value = std::string() 
) [inline]

Definition at line 176 of file ResolvableQuery.h.

References zypp::cache::Attribute::klass, zypp::cache::Attribute::name, and queryStringAttributeTranslation().

TranslatedText zypp::cache::ResolvableQuery::queryTranslatedStringAttribute ( const data::RecordId record_id,
const std::string &  klass,
const std::string &  name,
const TranslatedText default_value = TranslatedText() 
)

Queries all translations for a specific attribute in a resolvable.

Parameters:
record_id Resolvable cache id
klass Attribute Class
name Attribute Name
Returns:
all attribute translations or a empty TranslatedString if no record is found.

Definition at line 504 of file ResolvableQuery.cc.

References _pimpl.

Referenced by queryTranslatedStringAttribute().

TranslatedText zypp::cache::ResolvableQuery::queryTranslatedStringAttribute ( const data::RecordId record_id,
const Attribute attr,
const TranslatedText default_value = TranslatedText() 
) [inline]

Definition at line 198 of file ResolvableQuery.h.

References zypp::cache::Attribute::klass, zypp::cache::Attribute::name, and queryTranslatedStringAttribute().

template<class _OutputIterator>
void zypp::cache::ResolvableQuery::queryStringContainerAttribute ( const data::RecordId record_id,
const std::string &  klass,
const std::string &  name,
_OutputIterator  result 
) [inline]

Queries for a specific container attribute in a resolvable.

Parameters:
record_id Resolvable cache id
klass Attribute Class
name Attribute Name
The results are filled to the provided _OutputIterator

Definition at line 215 of file ResolvableQuery.h.

References zypp::ZConfig::instance(), queryStringAttribute(), and zypp::url::split().

Referenced by queryStringContainerAttribute().

template<class _OutputIterator>
void zypp::cache::ResolvableQuery::queryStringContainerAttribute ( const data::RecordId record_id,
const Attribute attr,
_OutputIterator  result 
) [inline]

Definition at line 227 of file ResolvableQuery.h.

References zypp::cache::Attribute::klass, zypp::cache::Attribute::name, and queryStringContainerAttribute().

void zypp::cache::ResolvableQuery::queryDiskUsage ( const data::RecordId record_id,
DiskUsage du 
)

Query disk usage for a resolvable

Definition at line 512 of file ResolvableQuery.cc.

References _pimpl.

std::string zypp::cache::ResolvableQuery::queryRepositoryAlias ( const data::RecordId repo_id  ) 

Query repo alias by id

Definition at line 517 of file ResolvableQuery.cc.

References _pimpl.

data::RecordId zypp::cache::ResolvableQuery::queryRepositoryId ( const std::string &  repo_alias  ) 

Query repo id by alias

void zypp::cache::ResolvableQuery::iterateResolvablesByKindsAndStringsAndRepos ( const std::vector< zypp::Resolvable::Kind > &  kinds,
const std::vector< std::string > &  names,
int  flags,
const std::vector< std::string > &  repos,
ProcessResolvable  fnc 
)

Iterate resolvables by Kinds and Strings

Parameters:
kinds kinds to match, will be ORed
names names to match, will be ANDed
repos repository aliases to match, will be ORed
flags MATCH_xxx, see above; applied to 'names'
fnc callback to send the data to. (Will be called once per result)
Beware: Searching for multiple strings with MATCH_EXACT will _not_ find anything, except if all strings are identical ...

Definition at line 522 of file ResolvableQuery.cc.

References _pimpl.


Member Data Documentation

RW_pointer<Impl> zypp::cache::ResolvableQuery::_pimpl [private]

Pointer to implementation.

Definition at line 265 of file ResolvableQuery.h.

Referenced by iterateResolvablesByKindsAndStringsAndRepos(), query(), queryBooleanAttribute(), queryDiskUsage(), queryNumericAttribute(), queryRepositoryAlias(), queryStringAttribute(), queryStringAttributeTranslation(), and queryTranslatedStringAttribute().


The documentation for this struct was generated from the following files:
Generated on Tue Sep 25 19:23:18 2007 for libzypp by  doxygen 1.5.3