Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
fmt::formatter< Engine::StringId > Struct Reference

Specialization of fmt::formatter for Engine::StringId, allowing it to be formatted using the fmt library. This formatter formats the StringId by extracting the original string representation from the underlying entt::hashed_string and formatting it as a std::string_view, which provides a human-readable representation of the StringId for debugging and logging purposes. More...

#include <Id.hpp>

Inheritance diagram for fmt::formatter< Engine::StringId >:

Public Member Functions

template<typename FormatContext>
auto format (const Engine::StringId &id, FormatContext &ctx) const
 Format an Engine::StringId by extracting its original string representation and formatting it as a std::string_view.

Detailed Description

Specialization of fmt::formatter for Engine::StringId, allowing it to be formatted using the fmt library. This formatter formats the StringId by extracting the original string representation from the underlying entt::hashed_string and formatting it as a std::string_view, which provides a human-readable representation of the StringId for debugging and logging purposes.

Member Function Documentation

◆ format()

template<typename FormatContext>
auto fmt::formatter< Engine::StringId >::format ( const Engine::StringId & id,
FormatContext & ctx ) const
inline

Format an Engine::StringId by extracting its original string representation and formatting it as a std::string_view.

Template Parameters
FormatContextThe type of the format context provided by fmt during formatting.
Parameters
idThe Engine::StringId instance to format.
ctxThe format context provided by fmt.
Returns
The result of formatting the original string representation of the Engine::StringId instance, extracted from its underlying entt::hashed_string value, as a std::string_view for human-readable output.
Todo
Put the implementation in the inl file if possible

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