Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

PPD Class Reference

#include <PPDdb.h>

List of all members.

Public Types

typedef string VendorKey
typedef string ModelKey
typedef string DriverKey
typedef map< DriverKey, DriverInfoDrivers
typedef map< ModelKey, ModelInfoModels
typedef map< VendorKey, VendorInfoVendors
typedef map< string, PpdFileInfoPpdFiles
typedef map< VendorKey, set<
string > > 
ModelLabels
typedef set< string > VendorLabels

Public Member Functions

 PPD (const char *ppddir=PPD_DIR, const char *ppddb=PPD_DB)
 ~PPD ()
bool createdb ()
void * createdbThread (const char *filename)
int creationStatus ()
bool changed (int *count)
string getVendorId (string vendor)
string getModelId (string vendor, string model)
bool fileinfo (const char *file, PPDInfo *info)
bool setCheckMethod (YCPSymbol method)
YCPList sortItems (const YCPMap &items)

Static Public Member Functions

void * startCreatedbThread (void *instance)

Protected Member Functions

string strupper (const string s)
string killchars (const string s, const string chr)
string killspaces (const string s)
string killbraces (const string s)
string addbrace (const string s)
string first (const string s, const string sep="-/")
string clean (const char *s)
string filternotchars (const string s, const string chr)
string regexpsub (const string input, const string pattern, const string result)
bool validateModel (const string vendor, const string printer)

Private Types

typedef map< string, string > VendorsMap
typedef map< string, vector<
pair< string, string > > > 
ModelsMap

Private Member Functions

bool mtimes (const char *dirname, time_t mtime, int *count)
int countFiles (const char *dirname)
bool process_dir (const char *dirname)
bool process_file (const char *filename, PPDInfo *newinfo=NULL)
void preprocess (PPDInfo info, PPDInfo *newinfo)
void addAdditionalInfo ()
void debugdb () const
bool loadPrebuiltDatabase ()
bool createFileList (const char *dirname, time_t mtime)
bool cleanupLists ()
bool processNewFiles ()
bool cleanupEmptyEntries ()
string fileChecksum (const string &filename)
off_t fileSize (const string &filename)
string updateLabel (const string &label)

Private Attributes

Vendors db
PpdFiles ppdfiles
ModelLabels modellabels
VendorLabels vendorlabels
string datadir
string var_datadir
char ppd_dir [MAX]
char ppd_db [MAX]
time_t mtime
VendorsMap vendors_map
ModelsMap models_map
volatile int creation_status
volatile int total_files
volatile int done_files
bool fast_check


Member Typedef Documentation

typedef string PPD::DriverKey
 

typedef map<DriverKey, DriverInfo> PPD::Drivers
 

typedef string PPD::ModelKey
 

typedef map<VendorKey, set<string> > PPD::ModelLabels
 

typedef map<ModelKey, ModelInfo> PPD::Models
 

typedef map<string, vector<pair <string, string> > > PPD::ModelsMap [private]
 

typedef map<string, PpdFileInfo> PPD::PpdFiles
 

typedef string PPD::VendorKey
 

typedef set<string> PPD::VendorLabels
 

typedef map<VendorKey, VendorInfo> PPD::Vendors
 

typedef map<string, string> PPD::VendorsMap [private]
 


Constructor & Destructor Documentation

PPD::PPD const char *  ppddir = PPD_DIR,
const char *  ppddb = PPD_DB
 

Constructor

Array of all known vendors

Array of all known string->vendor mappings

PPD::~PPD  ) 
 

Destructor


Member Function Documentation

void PPD::addAdditionalInfo  )  [private]
 

string PPD::addbrace const string  s  )  [protected]
 

Add a right brace if there is one left brace alone.

bool PPD::changed int *  count  ) 
 

Check if any ppd file has changed

string PPD::clean const char *  s  )  [protected]
 

Make s string from the char* and clean it from spaces and braces

bool PPD::cleanupEmptyEntries  )  [private]
 

bool PPD::cleanupLists  )  [private]
 

int PPD::countFiles const char *  dirname  )  [private]
 

Count files to process

bool PPD::createdb  ) 
 

Create database of printers Just start a thread and return immediately

void * PPD::createdbThread const char *  filename  ) 
 

Create a database of all ppd files in the /var/lib/YaST2/ppd_db.ycp

Returns:
operation succeeded

bool PPD::createFileList const char *  dirname,
time_t  mtime
[private]
 

Creates a list of files with attrubutes about modification dates

int PPD::creationStatus  ) 
 

void PPD::debugdb  )  const [private]
 

Debug whole ppd db to the y2log

string PPD::fileChecksum const string &  filename  )  [private]
 

bool PPD::fileinfo const char *  file,
PPDInfo info
 

Return info from the given file

off_t PPD::fileSize const string &  filename  )  [private]
 

string PPD::filternotchars const string  s,
const string  chr
[protected]
 

Filter characters, leavo only listed ones

string PPD::first const string  s,
const string  sep = " -/"
[protected]
 

Return the first word from the string

string PPD::getModelId string  vendor,
string  model
 

Transform model name from PPD file/detection to key in database

string PPD::getVendorId string  vendor  ) 
 

Transform vendor name from PPD file/detection to key in database

string PPD::killbraces const string  s  )  [protected]
 

Kill braces (and other bad characters) from the start and end of the string

string PPD::killchars const string  s,
const string  chr
[protected]
 

Kill the given chars from the start and end of the string

string PPD::killspaces const string  s  )  [protected]
 

Kill all spaces from the start and end of the string

bool PPD::loadPrebuiltDatabase  )  [private]
 

bool PPD::mtimes const char *  dirname,
time_t  mtime,
int *  count
[private]
 

Check modification times in the given directory

void PPD::preprocess PPD::PPDInfo  info,
PPDInfo newinfo
[private]
 

Preprocess the strings, apply hacks and update the db.

bool PPD::process_dir const char *  dirname  )  [private]
 

Search given directory for ppd files and update the ppd database

Parameters:
dirname directory to be processed
Returns:
operation succeeded

bool PPD::process_file const char *  filename,
PPDInfo newinfo = NULL
[private]
 

Process one PPD file

Parameters:
filename the file to be processed
Returns:
operation succeeded

bool PPD::processNewFiles  )  [private]
 

string PPD::regexpsub const string  input,
const string  pattern,
const string  result
[protected]
 

the same as YCP regexpsub builtin

bool PPD::setCheckMethod YCPSymbol  method  ) 
 

YCPList PPD::sortItems const YCPMap items  ) 
 

void * PPD::startCreatedbThread void *  instance  )  [static]
 

string PPD::strupper const string  s  )  [protected]
 

Convert string to upper characters

string PPD::updateLabel const string &  label  )  [private]
 

bool PPD::validateModel const string  vendor,
const string  printer
[protected]
 


Member Data Documentation

volatile int PPD::creation_status [private]
 

string PPD::datadir [private]
 

Vendors PPD::db [private]
 

volatile int PPD::done_files [private]
 

bool PPD::fast_check [private]
 

ModelLabels PPD::modellabels [private]
 

ModelsMap PPD::models_map [private]
 

time_t PPD::mtime [private]
 

char PPD::ppd_db[MAX] [private]
 

char PPD::ppd_dir[MAX] [private]
 

PpdFiles PPD::ppdfiles [private]
 

volatile int PPD::total_files [private]
 

string PPD::var_datadir [private]
 

VendorLabels PPD::vendorlabels [private]
 

VendorsMap PPD::vendors_map [private]
 


The documentation for this class was generated from the following files:
Generated on Thu Nov 17 21:26:41 2005 for yast2-printer by doxygen 1.3.6