CMS 3D CMS Logo

TarConstants.h

Go to the documentation of this file.
00001 #ifndef CLASSLIB_TAR_CONSTANTS_H
00002 # define CLASSLIB_TAR_CONSTANTS_H
00003 
00004 //<<<<<< INCLUDES                                                       >>>>>>
00005 
00006 # include "classlib/zip/ZipUtils.h"
00007 
00008 namespace lat {
00009 //<<<<<< PUBLIC DEFINES                                                 >>>>>>
00010 //<<<<<< PUBLIC CONSTANTS                                               >>>>>>
00011 //<<<<<< PUBLIC TYPES                                                   >>>>>>
00012 //<<<<<< PUBLIC VARIABLES                                               >>>>>>
00013 //<<<<<< PUBLIC FUNCTIONS                                               >>>>>>
00014 //<<<<<< CLASS DECLARATIONS                                             >>>>>>
00015 
00017 struct TarConstants : ZipUtils
00018 {
00019     // Unix file mode bits
00020     enum Mode {
00021         SUID            = 04000,//< Set-UID bit
00022         SGID            = 02000,//< Set-GID bit
00023         SVTX            = 01000,//< Sticky text bit
00024         UREAD           = 00400,//< User read bit
00025         UWRITE          = 00200,//< User write bit
00026         UEXEC           = 00100,//< User execute bit
00027         GREAD           = 00040,//< Group read bit
00028         GWRITE          = 00020,//< Group write bit
00029         GEXEC           = 00010,//< Group execute bit
00030         OREAD           = 00004,//< Other read bit
00031         OWRITE          = 00002,//< Other write bit
00032         OEXEC           = 00001 //< Other execute bit
00033     };
00034 
00035     // Archive member type
00036     enum Type {
00037         REGULAR         = '0',  //< Regular file
00038         HARD_LINK       = '1',  //< Hard link to another archive member
00039         SYM_LINK        = '2',  //< Symbolic link: no data, only link
00040         CHAR_DEVICE     = '3',  //< Character device: no data, only dev numbers
00041         BLOCK_DEVICE    = '4',  //< Block device: no data, only dev numbers
00042         DIRECTORY       = '5',  //< Directory: no data
00043         FIFO            = '6',  //< FIFO: no data, only name
00044         CONTIGUOUS      = '7'   //< Contiguously stored (regular) file
00045 
00046         // Known but unsupported:
00047         //  GNU_DIR_DUMP = 'D'  //< Directory entry with the file names at
00048         //                      //  the time the dump was made
00049         //  GNU_LONGLINK = 'K'  //< Next member in archive has long link name
00050         //  GNU_LONGNAME = 'L'  //< Next member in archive has long name
00051         //  GNU_MULTIVOL = 'M'  //< Continuation of a file on another volume
00052         //  GNU_NAMES    = 'N'  //< Filenames that did not fit in the main hdr
00053         //  GNU_SPARSE   = 'S'  //< Sparse file
00054         //  GNU_VOLHDR   = 'V'  //< Tape/volume header; ignore on extraction
00055     };
00056 
00057     // Header magic and version number strings
00058     static const char   *MAGIC; //< TAR archive magic (POSIX 1003.1-90)
00059     static const char   *VERSION;//< Header version identification string
00060 
00061     // Offsets into the central directory headers
00062     enum {
00063         NAME_OFFSET     = 0,    NAME_LENGTH     = 100,
00064         MODE_OFFSET     = 100,  MODE_LENGTH     = 8,
00065         UID_OFFSET      = 108,  UID_LENGTH      = 8,
00066         GID_OFFSET      = 116,  GID_LENGTH      = 8,
00067         SIZE_OFFSET     = 124,  SIZE_LENGTH     = 12,
00068         MTIME_OFFSET    = 136,  MTIME_LENGTH    = 12,
00069         CHKSUM_OFFSET   = 148,  CHKSUM_LENGTH   = 8,
00070         TYPE_OFFSET     = 156,  TYPE_LENGTH     = 1,
00071         LINK_OFFSET     = 157,  LINK_LENGTH     = 100,
00072         MAGIC_OFFSET    = 257,  MAGIC_LENGTH    = 6,
00073         VERSION_OFFSET  = 263,  VERSION_LENGTH  = 2,
00074         UNAME_OFFSET    = 265,  UNAME_LENGTH    = 32,
00075         GNAME_OFFSET    = 297,  GNAME_LENGTH    = 32,
00076         DEVMAJOR_OFFSET = 329,  DEVMAJOR_LENGTH = 8,
00077         DEVMINOR_OFFSET = 329,  DEVMINOR_LENGTH = 8,
00078         PREFIX_OFFSET   = 345,  PREFIX_LENGTH   = 155,
00079 
00080         HEADER_SIZE     = 512,
00081 
00082         // Maximum values for numeric values
00083         SMALL_MAX       = 0777777,      // 6 octal digits, space, null: uid...
00084         LARGE_MAX       = 07777777777   // 11 octal digits, space: size, mtime
00085     };
00086 };
00087 
00088 //<<<<<< INLINE PUBLIC FUNCTIONS                                        >>>>>>
00089 //<<<<<< INLINE MEMBER FUNCTIONS                                        >>>>>>
00090 
00091 } // namespace lat
00092 #endif // CLASSLIB_TAR_CONSTANTS_H

Generated on Tue Jun 9 17:39:00 2009 for CMSSW by  doxygen 1.5.4