feisty meow concerns codebase  2.140
manifest_chunk Struct Reference

we will read the manifest pieces out of our own exe image. More...

#include <common_bundle.h>

Inheritance diagram for manifest_chunk:
Collaboration diagram for manifest_chunk:

Public Member Functions

 manifest_chunk (int size, const basis::astring &target, int flags, const basis::astring &parms, const structures::string_set &keywords)
 the chunk is the unit found in the packing manifest in the bundle. More...
 
 manifest_chunk ()
 
virtual ~manifest_chunk ()
 
virtual void text_form (basis::base_string &state_fill) const
 Provides a text view of all the important info owned by this object. More...
 
 DEFINE_CLASS_NAME ("manifest_chunk")
 
void pack (basis::byte_array &target) const
 streams out into the "target". More...
 
bool unpack (basis::byte_array &source)
 streams in from the "source". More...
 
- Public Member Functions inherited from basis::text_formable
virtual const char * class_name () const =0
 Returns the bare name of this class as a constant character pointer. More...
 

Static Public Member Functions

static int packed_filetime_size ()
 
static bool read_manifest (filesystem::byte_filer &bundle, manifest_chunk &to_fill)
 reads a chunk out of the "bundle" and stores it in "to_fill". More...
 
static basis::astring read_a_string (filesystem::byte_filer &bundle)
 reads a string from the "bundle" file, one byte at a time. More...
 
static bool read_an_int (filesystem::byte_filer &bundle, basis::un_int &found)
 reads an integer (4 bytes) from the file into "found". More...
 
static bool read_an_obscured_int (filesystem::byte_filer &bundle, basis::un_int &found)
 reads in our obscured packing format for an int, which takes 8 bytes. More...
 
static bool read_a_filetime (filesystem::byte_filer &bundle, basis::byte_array &found)
 retrieves packed_filetime_size() byte timestamp from the "bundle". More...
 

Public Attributes

basis::un_int _size
 the size of the packed file. More...
 
basis::astring _payload
 guts of the chunk, such as location for file on target or a variable definition. More...
 
basis::un_int _flags
 uses the special_bundling_flags. More...
 
basis::astring _parms
 the parameters to pass on the command line. More...
 
structures::string_set _keywords
 keywords applicable to this item. More...
 
basis::byte_array c_filetime
 more than enough room for unix file time. More...
 

Detailed Description

we will read the manifest pieces out of our own exe image.

the manifest chunks provide us with enough information to unpack the data chunks that come afterward.

Definition at line 53 of file common_bundle.h.

Constructor & Destructor Documentation

◆ manifest_chunk() [1/2]

manifest_chunk::manifest_chunk ( int  size,
const basis::astring target,
int  flags,
const basis::astring parms,
const structures::string_set keywords 
)
inline

the chunk is the unit found in the packing manifest in the bundle.

Definition at line 68 of file common_bundle.h.

References c_filetime, and packed_filetime_size().

◆ manifest_chunk() [2/2]

manifest_chunk::manifest_chunk ( )
inline

< default constructor.

Definition at line 75 of file common_bundle.h.

References c_filetime, and packed_filetime_size().

◆ ~manifest_chunk()

manifest_chunk::~manifest_chunk ( )
virtual

Definition at line 28 of file common_bundle.cpp.

Member Function Documentation

◆ DEFINE_CLASS_NAME()

manifest_chunk::DEFINE_CLASS_NAME ( "manifest_chunk"  )

◆ pack()

void manifest_chunk::pack ( basis::byte_array target) const

streams out into the "target".

Definition at line 37 of file common_bundle.cpp.

References structures::attach(), and structures::obscure_attach().

◆ packed_filetime_size()

int manifest_chunk::packed_filetime_size ( )
static

Definition at line 31 of file common_bundle.cpp.

References filesystem::file_time::packed_size().

Referenced by manifest_chunk().

◆ read_a_filetime()

bool manifest_chunk::read_a_filetime ( filesystem::byte_filer bundle,
basis::byte_array found 
)
static

retrieves packed_filetime_size() byte timestamp from the "bundle".

Definition at line 78 of file common_bundle.cpp.

References FUNCDEF, and filesystem::byte_filer::read().

◆ read_a_string()

astring manifest_chunk::read_a_string ( filesystem::byte_filer bundle)
static

reads a string from the "bundle" file, one byte at a time.

Definition at line 89 of file common_bundle.cpp.

References filesystem::byte_filer::eof(), FUNCDEF, and filesystem::byte_filer::read().

◆ read_an_int()

bool manifest_chunk::read_an_int ( filesystem::byte_filer bundle,
basis::un_int found 
)
static

reads an integer (4 bytes) from the file into "found".

Definition at line 60 of file common_bundle.cpp.

References structures::detach(), FUNCDEF, and filesystem::byte_filer::read().

◆ read_an_obscured_int()

bool manifest_chunk::read_an_obscured_int ( filesystem::byte_filer bundle,
basis::un_int found 
)
static

reads in our obscured packing format for an int, which takes 8 bytes.

Definition at line 69 of file common_bundle.cpp.

References FUNCDEF, structures::obscure_detach(), and filesystem::byte_filer::read().

◆ read_manifest()

bool manifest_chunk::read_manifest ( filesystem::byte_filer bundle,
manifest_chunk to_fill 
)
static

reads a chunk out of the "bundle" and stores it in "to_fill".

false is returned if the read failed.

Definition at line 110 of file common_bundle.cpp.

References _flags, _keywords, _parms, _payload, _size, c_filetime, and basis::array< contents >::reset().

◆ text_form()

virtual void manifest_chunk::text_form ( basis::base_string state_fill) const
inlinevirtual

Provides a text view of all the important info owned by this object.

It is understood that there could be a large amount of information and that this function might take a relatively long time to complete.

Implements basis::text_formable.

Definition at line 82 of file common_bundle.h.

References _flags, _parms, _payload, _size, basis::base_string::assign(), basis::text_formable::class_name(), and basis::astring::s().

◆ unpack()

bool manifest_chunk::unpack ( basis::byte_array source)

Member Data Documentation

◆ _flags

basis::un_int manifest_chunk::_flags

uses the special_bundling_flags.

Definition at line 57 of file common_bundle.h.

Referenced by read_manifest(), and text_form().

◆ _keywords

structures::string_set manifest_chunk::_keywords

keywords applicable to this item.

Definition at line 59 of file common_bundle.h.

Referenced by read_manifest().

◆ _parms

basis::astring manifest_chunk::_parms

the parameters to pass on the command line.

Definition at line 58 of file common_bundle.h.

Referenced by read_manifest(), and text_form().

◆ _payload

basis::astring manifest_chunk::_payload

guts of the chunk, such as location for file on target or a variable definition.

Definition at line 56 of file common_bundle.h.

Referenced by read_manifest(), and text_form().

◆ _size

basis::un_int manifest_chunk::_size

the size of the packed file.

Definition at line 55 of file common_bundle.h.

Referenced by read_manifest(), and text_form().

◆ c_filetime

basis::byte_array manifest_chunk::c_filetime

more than enough room for unix file time.

Definition at line 60 of file common_bundle.h.

Referenced by manifest_chunk(), and read_manifest().


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