libfacade 1.1
A library for manipulating PNG images with payloads.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
facade::ICOPayload Class Reference

An icon file containing a payload. More...

#include <payload.hpp>

Inheritance diagram for facade::ICOPayload:
facade::ico::Icon

Public Member Functions

 ICOPayload ()
 
 ICOPayload (const void *ptr, std::size_t size)
 
 ICOPayload (const std::vector< std::uint8_t > &vec)
 
 ICOPayload (const std::string &filename)
 
 ICOPayload (const ICOPayload &other)
 
ICOPayloadoperator= (const ICOPayload &other)
 
PNGPayloadoperator-> (void)
 Syntactic sugar to access the PNG payload in the icon.
 
PNGPayloadoperator* (void)
 Syntactic sugar to access the PNG payload in the icon.
 
PNGPayloadpng_payload (void)
 Retrieve the PNG payload in this icon file.
 
const PNGPayloadpng_payload (void) const
 Retrieve a const PNG payload of this icon file.
 
void find_png (void)
 Find and set the PNG payload in this icon file.
 
void reset_png (void)
 Reset the underlying PNG payload to what's currently in the icon object.
 
void set_png (void)
 Convert the PNG payload to a file buffer and set it in the icon's bitmap directory.
 
- Public Member Functions inherited from facade::ico::Icon
 Icon ()
 
 Icon (const void *ptr, std::size_t size)
 
 Icon (const std::vector< std::uint8_t > &vec)
 
 Icon (const std::string &filename)
 
 Icon (const Icon &other)
 
Iconoperator= (const Icon &other)
 
Entryoperator[] (std::size_t index)
 Syntactic sugar to get an entry within the icon file.
 
const Entryoperator[] (std::size_t index) const
 Syntactic sugar to get a const entry within the icon file.
 
std::size_t size (void) const
 Return the number of bitmap entries within the icon file.
 
void parse (const void *ptr, std::size_t size)
 Parse the given pointer and size as an icon file.
 
void parse (const std::vector< std::uint8_t > &vec)
 Parse the given byte vector as an icon file.
 
void parse (const std::string &filename)
 Parse the given file as an icon file.
 
Entryget_entry (std::size_t index)
 Get a bitmap entry within the icon file.
 
const Entryget_entry (std::size_t index) const
 Get a const bitmap entry within the icon file.
 
void set_entry (std::size_t index, const Entry &data)
 Set the given entry at the given index in the icon file's bitmap directory.
 
void set_entry (std::size_t index, const IconDirEntry &entry, const std::vector< std::uint8_t > &data)
 Set the given entry object and image data at the given index in the icon file's bitmap directory.
 
EntryType entry_type (std::size_t index) const
 Return the type of bitmap the given directory bitmap is. Possible values are Icon::EntryType::ENTRY_BMP and Icon::EntryType::ENTRY_PNG.
 
std::vector< std::uint8_t > to_file () const
 Convert this icon object to its file representation.
 
void save (const std::string &filename) const
 Convert this icon object to a file and save it to disk.
 
void resize (std::size_t size)
 Resize the number of entries this icon object can hold.
 
Entryinsert_entry (std::size_t index, const Entry &entry)
 Insert and return the given bitmap entry at the given index.
 
Entryinsert_entry (std::size_t index, const IconDirEntry &entry, const std::vector< std::uint8_t > &data)
 Insert and return the given entry header and bitmap data at the given index.
 
Entryappend_entry (const Entry &entry)
 Append a bitmap entry pair to the end of this icon's bitmap directory.
 
Entryappend_entry (const IconDirEntry &entry, const std::vector< std::uint8_t > &data)
 Append an entry header and bitmap data to the end of the icon's bitmap directory.
 
void remove_entry (std::size_t index)
 Remove the bitmap entry at the given index.
 

Additional Inherited Members

- Public Types inherited from facade::ico::Icon
enum  EntryType { ENTRY_BMP = 0 , ENTRY_PNG }
 A simple enumeration to differentiate between PNG sections and bitmap sections. More...
 
using Entry = std::pair< IconDirEntry, std::vector< std::uint8_t > >
 A C++ representation of a bitmap entry within the icon file.
 

Detailed Description

An icon file containing a payload.

See also
PNGPayload

Note that in its current form, an icon file can only contain a payload if it contains a PNG entry. Attempting to turn an icon file without a PNG entry is an error. The only payload functionality that could possibly exist for icon bitmaps beside is steganography, which is not currently implemented for the icon bitmap format.

Constructor & Destructor Documentation

◆ ICOPayload() [1/5]

facade::ICOPayload::ICOPayload ( )
inline

◆ ICOPayload() [2/5]

facade::ICOPayload::ICOPayload ( const void *  ptr,
std::size_t  size 
)
inline

◆ ICOPayload() [3/5]

facade::ICOPayload::ICOPayload ( const std::vector< std::uint8_t > &  vec)
inline

◆ ICOPayload() [4/5]

facade::ICOPayload::ICOPayload ( const std::string &  filename)
inline

◆ ICOPayload() [5/5]

facade::ICOPayload::ICOPayload ( const ICOPayload other)
inline

Member Function Documentation

◆ find_png()

void ICOPayload::find_png ( void  )

Find and set the PNG payload in this icon file.

Exceptions
exception::NoPNGIcon

◆ operator*()

PNGPayload & ICOPayload::operator* ( void  )

Syntactic sugar to access the PNG payload in the icon.

◆ operator->()

PNGPayload * ICOPayload::operator-> ( void  )

Syntactic sugar to access the PNG payload in the icon.

◆ operator=()

ICOPayload & ICOPayload::operator= ( const ICOPayload other)

◆ png_payload() [1/2]

PNGPayload & ICOPayload::png_payload ( void  )

Retrieve the PNG payload in this icon file.

Exceptions
exception::NoPNGIcon

◆ png_payload() [2/2]

const PNGPayload & ICOPayload::png_payload ( void  ) const

Retrieve a const PNG payload of this icon file.

Exceptions
exception::NoPNGIcon

◆ reset_png()

void ICOPayload::reset_png ( void  )

Reset the underlying PNG payload to what's currently in the icon object.

◆ set_png()

void ICOPayload::set_png ( void  )

Convert the PNG payload to a file buffer and set it in the icon's bitmap directory.

Exceptions
exception::NoPNGIcon

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