00001 #ifndef COMMON_BUNDLER_DEFS
00002 #define COMMON_BUNDLER_DEFS
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00019
00024 #include <basis/istring.h>
00025 #include <basis/set.h>
00026 #include <basis/object_base.h>
00027
00028
00029 class byte_filer;
00030
00032
00034 enum special_bundling_flags {
00035 SOURCE_EXECUTE = 0x2,
00036 TARGET_EXECUTE = 0x4,
00037 RECURSIVE_SRC = 0x8,
00038 OMIT_PACKING = 0x10,
00039 SET_VARIABLE = 0x20,
00040 IGNORE_ERRORS = 0x40,
00041 NO_OVERWRITE = 0x80,
00042 QUIET_FAILURE = 0x100
00043 };
00044
00046
00048
00053 struct manifest_chunk
00054 {
00055 int _size;
00056 istring _target;
00057 int _flags;
00058 istring _parms;
00059 string_set _keywords;
00060 byte_array _timestamp;
00061
00062
00063
00064
00066 inline manifest_chunk(int size, const istring &target, int flags,
00067 const istring &parms, const string_set &keywords)
00068 : _size(size), _target(target), _flags(flags), _parms(parms),
00069 _keywords(keywords), _timestamp(8) {
00070 for (int i = 0; i < 8; i++) _timestamp[i] = 0;
00071 }
00072
00073 inline manifest_chunk() : _size(0), _flags(0), _timestamp(8) {
00075 for (int i = 0; i < 8; i++) _timestamp[i] = 0;
00076 }
00077
00078 virtual ~manifest_chunk();
00079
00080 IMPLEMENT_CLASS_NAME("manifest_chunk");
00081
00082 void pack(byte_array &target) const;
00083 bool unpack(byte_array &source);
00084
00085 static bool read_manifest(byte_filer &bundle, manifest_chunk &to_fill);
00087
00089 static istring read_a_string(byte_filer &bundle);
00091
00092 static bool read_an_int(byte_filer &bundle, int &found);
00094
00095 static bool read_an_obscured_int(byte_filer &bundle, int &found);
00097
00098 static bool read_a_timestamp(byte_filer &bundle, byte_array &found);
00100 };
00101
00103
00104 #endif
00105