apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pkgAcqMethod Class Reference

#include <acquire-method.h>

Inheritance diagram for pkgAcqMethod:
[legend]
Collaboration diagram for pkgAcqMethod:
[legend]

Classes

struct  FetchItem
 
struct  FetchResult
 

Public Types

enum  CnfFlags {
  SingleInstance = (1 << 0) , Pipeline = (1 << 1) , SendConfig = (1 << 2) , LocalOnly = (1 << 3) ,
  NeedsCleanup = (1 << 4) , Removable = (1 << 5) , AuxRequests = (1 << 6) , SendURIEncoded = (1 << 7)
}
 

Public Member Functions

void Log (const char *Format,...)
 
void Status (const char *Format,...)
 
void Redirect (const std::string &NewURI)
 
int Run (bool Single=false)
 
void SetFailReason (std::string Msg)
 
void SetIP (std::string aIP)
 
 pkgAcqMethod (const char *Ver, unsigned long Flags=0)
 
virtual ~pkgAcqMethod ()
 
void DropPrivsOrDie ()
 

Protected Member Functions

virtual bool Configuration (std::string Message)
 
virtual bool Fetch (FetchItem *)
 
virtual bool URIAcquire (std::string const &, FetchItem *Itm)
 
void Fail (bool Transient=false)
 
void Fail (const char *Why, bool Transient=false)
 
virtual void Fail (std::string Why, bool Transient=false)
 
virtual void URIStart (FetchResult &Res)
 
virtual void URIDone (FetchResult &Res, FetchResult *Alt=0)
 
void SendMessage (std::string const &header, std::unordered_map< std::string, std::string > &&fields)
 
bool MediaFail (std::string Required, std::string Drive)
 
virtual void Exit ()
 
 APT_DEPRECATED_MSG ("Use SendMessage instead") void PrintStatus(char const *const header
 

Protected Attributes

std::vector< std::string > Messages
 
FetchItemQueue
 
FetchItemQueueBack
 
std::string FailReason
 
std::string UsedMirror
 
std::string IP
 
const char * Format
 
const char va_list &args const
 

Private Member Functions

APT_HIDDEN void Dequeue ()
 

Detailed Description

Definition at line 33 of file acquire-method.h.

Member Enumeration Documentation

◆ CnfFlags

enum CnfFlags
Enumerator
SingleInstance 
Pipeline 
SendConfig 
LocalOnly 
NeedsCleanup 
Removable 
AuxRequests 
SendURIEncoded 

Definition at line 107 of file acquire-method.h.

Constructor & Destructor Documentation

◆ pkgAcqMethod()

pkgAcqMethod ( const char *  Ver,
unsigned long  Flags = 0 
)

◆ ~pkgAcqMethod()

~pkgAcqMethod ( )
virtual

Definition at line 577 of file acquire-method.cc.

Member Function Documentation

◆ APT_DEPRECATED_MSG()

APT_DEPRECATED_MSG ( "Use SendMessage instead"  ) const
protected

◆ Configuration()

bool Configuration ( std::string  Message)
protectedvirtual

◆ Dequeue()

void Dequeue ( )
private

Definition at line 569 of file acquire-method.cc.

References pkgAcqMethod::FetchItem::Next, Queue, and QueueBack.

Referenced by Fail(), Redirect(), and URIDone().

◆ DropPrivsOrDie()

void DropPrivsOrDie ( )

Definition at line 201 of file acquire-method.cc.

References DropPrivileges(), and Fail().

Referenced by aptMethod::Configuration(), and aptAuthConfMethod::Configuration().

◆ Exit()

virtual void Exit ( )
inlineprotectedvirtual

Reimplemented in CDROMMethod.

Definition at line 102 of file acquire-method.h.

Referenced by Run().

◆ Fail() [1/3]

◆ Fail() [2/3]

void Fail ( const char *  Why,
bool  Transient = false 
)
inlineprotected

Definition at line 95 of file acquire-method.h.

References Fail().

Referenced by Fail().

◆ Fail() [3/3]

void Fail ( std::string  Why,
bool  Transient = false 
)
protectedvirtual

◆ Fetch()

virtual bool Fetch ( FetchItem )
inlineprotectedvirtual

Reimplemented in BaseHttpMethod, CDROMMethod, CopyMethod, FileMethod, FtpMethod, RSHMethod, and StoreMethod.

Definition at line 90 of file acquire-method.h.

◆ Log()

void Log ( const char *  Format,
  ... 
)

◆ MediaFail()

bool MediaFail ( std::string  Required,
std::string  Drive 
)
protected

Definition at line 291 of file acquire-method.cc.

References LookupTag(), Messages, ReadMessages(), StringToBool(), and WaitFd().

Referenced by CDROMMethod::Fetch().

◆ Redirect()

void Redirect ( const std::string &  NewURI)

◆ Run()

◆ SendMessage()

void SendMessage ( std::string const header,
std::unordered_map< std::string, std::string > &&  fields 
)
protected

◆ SetFailReason()

◆ SetIP()

void SetIP ( std::string  aIP)
inline

Definition at line 126 of file acquire-method.h.

Referenced by Connection::Take().

◆ Status()

◆ URIAcquire()

virtual bool URIAcquire ( std::string const ,
FetchItem Itm 
)
inlineprotectedvirtual

Reimplemented in GPGVMethod, MirrorMethod, and RredMethod.

Definition at line 91 of file acquire-method.h.

Referenced by Run().

◆ URIDone()

◆ URIStart()

Member Data Documentation

◆ const

const char va_list& args const
protected

Definition at line 104 of file acquire-method.h.

◆ FailReason

std::string FailReason
protected

Definition at line 84 of file acquire-method.h.

Referenced by Fail(), and BaseHttpMethod::Loop().

◆ Format

const char* Format
protected

Definition at line 104 of file acquire-method.h.

Referenced by Log(), and Status().

◆ IP

std::string IP
protected

Definition at line 86 of file acquire-method.h.

Referenced by Fail().

◆ Messages

std::vector<std::string> Messages
protected

Definition at line 81 of file acquire-method.h.

Referenced by MediaFail(), and Run().

◆ Queue

◆ QueueBack

◆ UsedMirror

std::string UsedMirror
protected

Definition at line 85 of file acquire-method.h.

Referenced by Fail(), Log(), Status(), URIDone(), URIStart(), and aptMethod::Warning().


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