Object structure. More...

#include <Object.h>

Collaboration diagram for IFS::FWFS::Object:

Public Types

enum  Type { Type::XX }
 
enum  Attribute { Attribute::ReadOnly, Attribute::Archive, Attribute::Encrypted, Attribute::MAX }
 Object attributes. More...
 
using ID = uint32_t
 Object identifier (offset from start of image) More...
 
using Attributes = BitSet< uint8_t, Attribute, size_t(Attribute::MAX)>
 

Public Member Functions

Type type () const
 
void setType (Type type, bool isRef=false)
 
bool isRef () const
 
uint32_t getRef () const
 
bool isNamed () const
 
bool isData () const
 
bool isDir () const
 
bool isMountPoint () const
 
size_t contentOffset () const
 return offset to start of object content More...
 
uint32_t contentSize () const
 return size of object content, excluding header and size fields More...
 
void setContentSize (size_t size)
 
uint32_t childTableOffset () const
 
uint32_t childTableSize () const
 
uint32_t size () const
 total size this object occupies in the image More...
 

Public Attributes

uint8_t typeData
 Stored type plus flag. More...
 
union {
   struct {
      uint8_t   _contentSize
 
      union {
         struct {
            uint32_t   packedOffset
 
         }   ref
 
         struct {
            uint32_t   value
 32-bit identifier, e.g. volume ID More...
 
         }   id32
 
         struct {
            uint8_t   attr
 
         }   objectAttributes
 
         Compression   compression
 
         struct {
            UserRole   role
 
         }   ace
 
         struct {
            uint8_t   index
 
         }   volumeIndex
 
         struct {
            uint8_t   tagValue
 
         }   userAttribute
 
         struct {
            uint32_t   checksum
 
         }   end
 
      } 
 
   }   data8
 
   struct {
      uint16_t   _contentSize
 
      union {
         struct {
            uint8_t   namelen
 Length of object name. More...
 
            TimeStamp   mtime
 
         }   named
 
      } 
 
   }   data16
 
   struct {
      uint16_t   _contentSize
 Object size (excluding this header) More...
 
      uint8_t   _contentSizeHigh
 Allows data up to 16MByte. More...
 
   }   data24
 
}; 
 

Static Public Attributes

static constexpr uint8_t FWOBT_REF {0x80}
 

Detailed Description

Object structure.

Note
all objects conform to this structure. Only the first word (4 bytes) are required to nagivate the file system. All objects have an 8, 16 or 24-bit size field. Content is always immediately after this field. Reference objects are always 8-bit sized.

Member Typedef Documentation

◆ Attributes

◆ ID

using IFS::FWFS::Object::ID = uint32_t

Object identifier (offset from start of image)

Member Enumeration Documentation

◆ Attribute

Object attributes.

Note
these are bit values
Enumerator
ReadOnly 

Object should not be modified or deleted.

Archive 

Object modified flag.

Note
Object has been changed on disk. Typically used by backup applications
Encrypted 

Object data is encrypted.

This is just a hint. Applications will typically provide additional user metadata to provide any additional information required for decryption.

MAX 

◆ Type

Enumerator
XX 

Member Function Documentation

◆ childTableOffset()

uint32_t IFS::FWFS::Object::childTableOffset ( ) const
inline

◆ childTableSize()

uint32_t IFS::FWFS::Object::childTableSize ( ) const
inline

◆ contentOffset()

size_t IFS::FWFS::Object::contentOffset ( ) const
inline

return offset to start of object content

◆ contentSize()

uint32_t IFS::FWFS::Object::contentSize ( ) const
inline

return size of object content, excluding header and size fields

Return values
sizeor error code
Note
must check return error code

◆ getRef()

uint32_t IFS::FWFS::Object::getRef ( ) const
inline

◆ isData()

bool IFS::FWFS::Object::isData ( ) const
inline

◆ isDir()

bool IFS::FWFS::Object::isDir ( ) const
inline

◆ isMountPoint()

bool IFS::FWFS::Object::isMountPoint ( ) const
inline

◆ isNamed()

bool IFS::FWFS::Object::isNamed ( ) const
inline

◆ isRef()

bool IFS::FWFS::Object::isRef ( ) const
inline

◆ setContentSize()

void IFS::FWFS::Object::setContentSize ( size_t  size)
inline

◆ setType()

void IFS::FWFS::Object::setType ( Type  type,
bool  isRef = false 
)
inline

◆ size()

uint32_t IFS::FWFS::Object::size ( ) const
inline

total size this object occupies in the image

Return values
sizeor error code

◆ type()

Type IFS::FWFS::Object::type ( ) const
inline

Member Data Documentation

◆ @27

union { ... }

◆ _contentSize [1/2]

uint8_t IFS::FWFS::Object::_contentSize

◆ _contentSize [2/2]

uint16_t IFS::FWFS::Object::_contentSize

Object size (excluding this header)

◆ _contentSizeHigh

uint8_t IFS::FWFS::Object::_contentSizeHigh

Allows data up to 16MByte.

◆ ace

struct { ... } IFS::FWFS::Object::ace

◆ attr

uint8_t IFS::FWFS::Object::attr

◆ checksum

uint32_t IFS::FWFS::Object::checksum

◆ compression

Compression IFS::FWFS::Object::compression

◆ data16

struct { ... } IFS::FWFS::Object::data16

◆ data24

struct { ... } IFS::FWFS::Object::data24

◆ data8

struct { ... } IFS::FWFS::Object::data8

◆ end

struct { ... } IFS::FWFS::Object::end

◆ FWOBT_REF

constexpr uint8_t IFS::FWFS::Object::FWOBT_REF {0x80}
staticconstexpr

◆ id32

struct { ... } IFS::FWFS::Object::id32

◆ index

uint8_t IFS::FWFS::Object::index

◆ mtime

TimeStamp IFS::FWFS::Object::mtime

◆ named

struct { ... } IFS::FWFS::Object::named

◆ namelen

uint8_t IFS::FWFS::Object::namelen

Length of object name.

◆ objectAttributes

struct { ... } IFS::FWFS::Object::objectAttributes

◆ packedOffset

uint32_t IFS::FWFS::Object::packedOffset

◆ ref

struct { ... } IFS::FWFS::Object::ref

◆ role

UserRole IFS::FWFS::Object::role

◆ tagValue

uint8_t IFS::FWFS::Object::tagValue

◆ typeData

uint8_t IFS::FWFS::Object::typeData

Stored type plus flag.

◆ userAttribute

struct { ... } IFS::FWFS::Object::userAttribute

◆ value

uint32_t IFS::FWFS::Object::value

32-bit identifier, e.g. volume ID

◆ volumeIndex

struct { ... } IFS::FWFS::Object::volumeIndex

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