cesium-native  0.41.0
CesiumGltf::MetadataConversions< bool, std::string > Struct Reference

Converts from std::string to a bool. More...

#include <CesiumGltf/MetadataConversions.h>

Static Public Member Functions

static std::optional< bool > convert (const std::string &from)
 Converts the contents of a std::string to a boolean. More...
 

Detailed Description

Converts from std::string to a bool.

Definition at line 109 of file MetadataConversions.h.

Member Function Documentation

◆ convert()

static std::optional<bool> CesiumGltf::MetadataConversions< bool, std::string >::convert ( const std::string &  from)
inlinestatic

Converts the contents of a std::string to a boolean.

"0", "false", and "no" (case-insensitive) are converted to false, while "1", "true", and "yes" are converted to true. All other strings will return std::nullopt.

Parameters
fromThe std::string to convert from.

Definition at line 120 of file MetadataConversions.h.


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