jigdo API

UrlMap Class Reference

Object containing list of all Part and Server mappings in a .jigdo file. More...

#include <url-mapping.hh>

Inheritance diagram for UrlMap:

NoCopy

List of all members.


Public Types

typedef map< MD5, SmartPtr
< PartUrlMapping > > 
PartMap
typedef map< string, SmartPtr
< ServerUrlMapping > > 
ServerMap

Public Member Functions

 UrlMap ()
const char * addPart (const string &baseUrl, const MD5 &md, const vector< string > &value)
 Add info about a mapping line inside one of the [Parts] sections in the .jigdo sections.
const char * addPart (const string &baseUrl, const vector< string > &value, SmartPtr< PartUrlMapping > *oldList)
 Like addPart(), but intended for maintaining lists of PartUrlMapping objects where the checksum is not known.
const char * addServer (const string &baseUrl, const string &label, const vector< string > &value)
 Add info about a [Servers] line, cf addPart().
void dumpJigdoInfo ()
 Output the graph built up by addPart()/addServer() to the log.
const PartMapparts () const
const ServerMapservers () const
PartUrlMappingoperator[] (const MD5 &m) const
 Make lookups.

Detailed Description

Object containing list of all Part and Server mappings in a .jigdo file.

Member Typedef Documentation


Constructor & Destructor Documentation

UrlMap::UrlMap (  )  [inline]


Member Function Documentation

const char * UrlMap::addPart ( const string &  baseUrl,
const MD5 md,
const vector< string > &  value 
)

Add info about a mapping line inside one of the [Parts] sections in the .jigdo sections.

The first entry of "value" is the URL (absolute, relative to baseUrl or in "Label:some/path form). The remaining "value" entries are assumed to be options.

Returns:
null if success, else error message

References findLabelColon(), Paranoid, uriJoin(), and x.

Referenced by ap(), and score1().

const char * UrlMap::addPart ( const string &  baseUrl,
const vector< string > &  value,
SmartPtr< PartUrlMapping > *  oldList 
)

Like addPart(), but intended for maintaining lists of PartUrlMapping objects where the checksum is not known.

Used to maintain lists of URLs for .template files. While it does not alter the checksum=>PartUrlMapping mappings of this UrlMap, it /may/ alter the Label=>ServerUrlMapping mappings, and the returned/appended PartUrlMapping will reference the server mappings of this UrlMap.

Parameters:
baseUrl Base URL, in case value.front() is a relative URL
value value.front() is the URL, followed by args for the part
oldList Pointer to 0 SmartPtr for first call, will create list head, or pointer to SmartPtr to list head, will then add to list.

References Assert, findLabelColon(), and uriJoin().

const char * UrlMap::addServer ( const string &  baseUrl,
const string &  label,
const vector< string > &  value 
)

Add info about a [Servers] line, cf addPart().

For a line "Foobar=Label:some/path" in the [Servers] section:

Parameters:
baseUrl Base URL, in case value.front() is a relative URL
label == "Foobar"
value arguments; value.front()=="Label:some/path"
Returns:
null if success, else error message

References _, debug, findLabelColon(), UrlMapping::parseOptions(), UrlMapping::prepend(), UrlMapping::setPrepend(), UrlMapping::setUrl(), and uriJoin().

Referenced by as().

void UrlMap::dumpJigdoInfo (  ) 

Output the graph built up by addPart()/addServer() to the log.

References debug, UrlMapping::next(), UrlMapping::prepend(), and UrlMapping::url().

Referenced by score1(), score2(), score3(), score4(), score5(), test1(), test2(), test3(), and test4().

const PartMap& UrlMap::parts (  )  const [inline]

Referenced by operator[]().

const ServerMap& UrlMap::servers (  )  const [inline]

PartUrlMapping * UrlMap::operator[] ( const MD5 m  )  const [inline]

Make lookups.

References end, and parts().


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

Generated on Tue Sep 23 14:27:43 2008 for jigdo by  doxygen 1.5.6