Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Static Public Attributes

# CArchive Class Reference

Inheritance diagram for CArchive:

List of all members.

## Public Member Functions
def | __init__
def | add
def | checkmagic
def | contents
def | extract
def | loadtoc
def | openEmbedded
def | save_toc
def | save_trailer
## Public Attributes
| len
| pkgstart
| toc
| toclen
| tocpos
## Static Public Attributes
int | HDRLEN = 0
int | LEVEL = 9
string | MAGIC = 'MEI\014\013\012\013\015'
| TOCTMPLT = CTOC
int | TRLLEN = 20
string | TRLSTRUCT = '8siii'

## Detailed Description

    An Archive subclass that an hold arbitrary data.

       Easily handled from C or from Python.

## Constructor & Destructor Documentation

def __init__ | ( |  | self,
|  |  | path = `None`,
|  |  | start = `0`,
|  |  | len = `0`
| ) |  |

    Constructor.

       PATH is path name of file (create an empty CArchive if path is None).
       START is the seekposition within PATH.
       LEN is the length of the CArchive (if 0, then read till EOF).

## Member Function Documentation

def add | ( |  | self,
|  |  | entry
| ) |  |

    Add an ENTRY to the CArchive.

       ENTRY must have:
     entry[0] is name (under which it will be saved).
     entry[1] is fullpathname of the file.
     entry[2] is a flag for it's storage format (0==uncompressed,
     1==compressed, 2==Python source format)
     entry[3] is the entry's type code.

Reimplemented from Archive.

def checkmagic | ( |  | self | ) |

    Verify that self is a valid CArchive.

    Magic signature is at end of the archive.

Reimplemented from Archive.

def contents | ( |  | self | ) |

    Return the names of the entries

Reimplemented from Archive.

def extract | ( |  | self,
|  |  | name
| ) |  |

    Get the contents of an entry.

       NAME is an entry name.
       Return the tuple (ispkg, contents).
       For non-Python resoures, ispkg is meaningless (and 0).
       Used by the import mechanism.

Reimplemented from Archive.

def loadtoc | ( |  | self | ) |

    Load the table of contents into memory.

Reimplemented from Archive.

def openEmbedded | ( |  | self,
|  |  | name
| ) |  |

    Open a CArchive of name NAME embedded within this CArchive.

def save_toc | ( |  | self,
|  |  | tocpos
| ) |  |

    Save the table of contents to disk.

Reimplemented from Archive.

def save_trailer | ( |  | self,
|  |  | tocpos
| ) |  |

    Save the trailer to disk.

       CArchives can be opened from the end - the trailer points
       back to the start.

Reimplemented from Archive.

## Member Data Documentation

int HDRLEN = 0`[static]`

Reimplemented from Archive.

len

int LEVEL = 9`[static]`

string MAGIC = 'MEI\014\013\012\013\015'`[static]`

Reimplemented from Archive.

pkgstart

toc

Reimplemented from Archive.

toclen

tocpos

TOCTMPLT = CTOC`[static]`

Reimplemented from Archive.

int TRLLEN = 20`[static]`

Reimplemented from Archive.

string TRLSTRUCT = '8siii'`[static]`

All Classes Namespaces Functions Variables Enumerations Enumerator Properties