XDGKit v0.1.0-1
XDG Utilities for C++
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
XDGIcon Class Reference

Properties of an icon. More...

#include <XDGIcon.h>

Public Types

enum  Extension
 Enumeration of supported file extensions for icons. More...
 

Public Member Functions

XDGKitkit () const noexcept
 Handle to the parent kit.
 
uint32_t extensions () const noexcept
 Retrieves the bitset of file extensions found for this icon.
 
const char * name () const noexcept
 Retrieves the name of the icon.
 
std::filesystem::path getPath (Extension ext) const noexcept
 Retrieves the absolute path of the icon for a specified file extension.
 
XDGIconDirectorydirectory () const noexcept
 Retrieves the directory to which this icon belongs.
 

Detailed Description

Properties of an icon.

This class provides information about an icon, including its name, file extensions, paths, and the directory to which it belongs.

Member Enumeration Documentation

◆ Extension

enum Extension

Enumeration of supported file extensions for icons.

Enumerator
PNG 

PNG file format.

SVG 

SVG file format.

XPM 

XPM file format.

Member Function Documentation

◆ kit()

XDGKit & kit ( ) const
noexcept

Handle to the parent kit.

◆ extensions()

uint32_t extensions ( ) const
inlinenoexcept

Retrieves the bitset of file extensions found for this icon.

Each bit in the bitset corresponds to a supported file extension.

Returns
A bitset of file extensions (e.g., PNG, SVG, XPM).

◆ name()

const char * name ( ) const
inlinenoexcept

Retrieves the name of the icon.

Returns
A constant reference to the icon's name.

◆ getPath()

std::filesystem::path getPath ( Extension  ext) const
noexcept

Retrieves the absolute path of the icon for a specified file extension.

The provided extension must exist in the set of extensions returned by extensions().

Parameters
extThe file extension for which to retrieve the icon's path.
Returns
The absolute path of the icon file with the specified extension.

◆ directory()

XDGIconDirectory & directory ( ) const
inlinenoexcept

Retrieves the directory to which this icon belongs.

The directory contains information such as size, scale, and context of the icon.

Returns
A reference to the XDGIconDirectory object representing the directory.