OpenTTD Source 20260721-master-g25ec12c62d
BaseLabel Struct Reference

Base for a four character label/tag/id. More...

#include <label_type.hpp>

Inheritance diagram for BaseLabel:
Label< struct CargoLabelTag > Label< struct NodeIDTag > Label< NewGRFClass< Tspec, Tindex > > Label< struct GrfIDTag > Label< struct RailTypeLabelTag > Label< struct RoadTypeLabelTag > Label< struct SaveLoadFormatLabelTag > Label< struct ChunkIdTag > Label< struct WavTagTag > Label< Tag >

Public Member Functions

constexpr bool Empty () const
 Check whether the label is empty.
std::string AsString () const
 Get the label as a std::string.

Detailed Description

Base for a four character label/tag/id.

Definition at line 14 of file label_type.hpp.

Member Function Documentation

◆ AsString()

std::string BaseLabel::AsString ( ) const

Get the label as a std::string.

If the label is all std::isgraph characters, it will return these characters as string, otherwise it will format it as a 8-digit hexadecimal.

Returns
The label as string.

Definition at line 22 of file label.cpp.

References FormatArrayAsHex().

Referenced by ConDumpRailTypes(), and ConDumpRoadTypes().

◆ Empty()


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