Click
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ArchiveElement Class Reference

Member of an 'ar' archive. More...

#include <archive.hh>

Public Member Functions

bool live () const
 Return true iff the member should be included in an archive.
 
void kill ()
 Kill a member, preventing it from being archived.
 

Static Public Member Functions

static int parse (const String &str, Vector< ArchiveElement > &ar, ErrorHandler *errh=0)
 Parse a string into a vector of ArchiveElement objects.
 
static String unparse (const Vector< ArchiveElement > &ar, ErrorHandler *errh=0)
 Unparse a vector of ArchiveElement objects into a string.
 
static ArchiveElement * find (Vector< ArchiveElement > &ar, const String &name)
 Locate an ArchiveElement in an archive by name.
 
static const ArchiveElement * find (const Vector< ArchiveElement > &ar, const String &name)
 
static int extract (const Vector< ArchiveElement > &ar, const String &name, const String &dest, ErrorHandler *errh=0)
 

Public Attributes

String name
 Member name (no slashes allowed)
 
int date
 Decimal seconds since the epoch (1/1/1970)
 
int uid
 User ID of member.
 
int gid
 Group ID of member.
 
int mode
 File mode.
 
String data
 Member contents.
 

Detailed Description

Member of an 'ar' archive.

The ArchiveElement class represents members of ar(1) archives. Click uses the simple ar(1) format for passing configurations with additional information, such as compiled packages and element maps. An archive member consists of a name, data, and additional metadata. Complete archives are represented as vectors of ArchiveElement objects.

Member Function Documentation

◆ live()

bool ArchiveElement::live ( ) const
inline

Return true iff the member should be included in an archive.

◆ kill()

void ArchiveElement::kill ( )
inline

Kill a member, preventing it from being archived.

◆ parse()

int ArchiveElement::parse ( const String &  str,
Vector< ArchiveElement > &  ar,
ErrorHandler *  errh = 0 
)
static

Parse a string into a vector of ArchiveElement objects.

Parameters
strinput string
[out]ararchive elements
errherror message receiver
Returns
0 on success, < 0 on failure

◆ unparse()

String ArchiveElement::unparse ( const Vector< ArchiveElement > &  ar,
ErrorHandler *  errh = 0 
)
static

Unparse a vector of ArchiveElement objects into a string.

Parameters
ararchive elements
errherror message receiver
Returns
archive string, suitable for parse()

◆ find() [1/2]

static ArchiveElement * ArchiveElement::find ( Vector< ArchiveElement > &  ar,
const String &  name 
)
inlinestatic

Locate an ArchiveElement in an archive by name.

Parameters
ararchive elements
nameelement name
Returns
pointer to matching archive element, or 0 if none exists

◆ find() [2/2]

static const ArchiveElement * ArchiveElement::find ( const Vector< ArchiveElement > &  ar,
const String &  name 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Data Documentation

◆ name

String ArchiveElement::name

Member name (no slashes allowed)

◆ date

int ArchiveElement::date

Decimal seconds since the epoch (1/1/1970)

◆ uid

int ArchiveElement::uid

User ID of member.

◆ gid

int ArchiveElement::gid

Group ID of member.

◆ mode

int ArchiveElement::mode

File mode.

◆ data

String ArchiveElement::data

Member contents.


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