LibPkg
Public Types | Public Member Functions | Friends | List of all members
pkg::log Class Reference

Class to log actions that occur in LibPkg. More...

#include <log.h>

Public Types

typedef std::vector< log_entry >
::const_iterator 
const_iterator
 Iterator type for the log entries. More...
 

Public Member Functions

 log ()
 Construct an empty log. More...
 
bool bad () const
 The log failed to add one or more items. More...
 
void message (LogCode code, const char *param1=0, const char *param2=0)
 Add a new entry to the log. More...
 
void message (LogCode code, const std::string &param)
 Add a new entry to the log from a standard string. More...
 
void message (LogCode code, const std::string &param1, const std::string &param2)
 Add a new entry to the log from two standard strings. More...
 
const_iterator begin () const
 Iterator to first log entry. More...
 
const_iterator end () const
 Iterator to last log entry. More...
 
unsigned int size () const
 Total number of entries. More...
 
unsigned int errors () const
 Number of errors. More...
 
unsigned int warnings () const
 Number of warnings. More...
 
const log_entryoperator[] (int index) const
 Return entry for a given index. More...
 
const log_entryentry (int index) const
 Return entry for a given index. More...
 

Friends

std::ostream & operator<< (std::ostream &stream, const log &olog)
 Output log as text. More...
 

Detailed Description

Class to log actions that occur in LibPkg.

Member Typedef Documentation

Iterator type for the log entries.

Constructor & Destructor Documentation

pkg::log::log ( )

Construct an empty log.

Member Function Documentation

bool pkg::log::bad ( ) const
inline

The log failed to add one or more items.

Returns
true if add failure
void pkg::log::message ( LogCode  code,
const char *  param1 = 0,
const char *  param2 = 0 
)

Add a new entry to the log.

Parameters
codeEntry log code
param1first parameter or 0 (the default) for none
param2second parameter or 0 (the default) for none

Referenced by pkg::commit::log_to(), pkg::update::poll(), pkg::commit::poll(), and pkg::unpack::poll().

void pkg::log::message ( LogCode  code,
const std::string &  param 
)
inline

Add a new entry to the log from a standard string.

Parameters
codeEntry log code
paramfirst parameter

References message().

Referenced by message().

void pkg::log::message ( LogCode  code,
const std::string &  param1,
const std::string &  param2 
)
inline

Add a new entry to the log from two standard strings.

Parameters
codeEntry log code
param1first parameter
param2second parameter

References message().

Referenced by message().

const_iterator pkg::log::begin ( ) const
inline

Iterator to first log entry.

const_iterator pkg::log::end ( ) const
inline

Iterator to last log entry.

unsigned int pkg::log::size ( ) const
inline

Total number of entries.

unsigned int pkg::log::errors ( ) const
inline

Number of errors.

unsigned int pkg::log::warnings ( ) const
inline

Number of warnings.

const log_entry& pkg::log::operator[] ( int  index) const
inline

Return entry for a given index.

const log_entry& pkg::log::entry ( int  index) const
inline

Return entry for a given index.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const log olog 
)
friend

Output log as text.


The documentation for this class was generated from the following files:

Reference Manual LibPkg Version 0.6.1 (28 Jan 2015)