Layers 2.0 is archived. The latest version is 3.0. Read the 3.0 docs

LResourceManager Class

#include <Layers/lresources.h>

Public Functions

void init(const void * entries, size_t count)
LResourceManager & instance()
LResource resource(const LString & path)
std::map<LString, LResource> resources(const LString & path)

Detailed Description

Manages compiled resources generated by the Layers Resource Compiler.

The resource manager provides access to styles and other resources that have been compiled into the binary through the .lrc build process. Use the lResourceManager macro to access the singleton instance.

Member Function Documentation

void init(const void * entries, size_t count)

Initializes the resource manager with compiled resource entries.

This is called automatically by the generated resource initialization code.

LResourceManager & instance()

Returns the singleton resource manager instance.

Prefer using the lResourceManager macro instead.

LResource resource(const LString & path)

Retrieves a single resource by its path.

Returns an LResource with null data if the resource is not found.

std::map<LString, LResource> resources(const LString & path)

Retrieves all resources under the given path prefix.

Returns a map of resource paths to their data.

Appearance
Theme
—