cesium-native 0.48.0
Loading...
Searching...
No Matches
CesiumGltf::MetadataConversions< bool, std::string_view > Struct Reference

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

#include <CesiumGltf/MetadataConversions.h>

Static Public Member Functions

static std::optional< bool > convert (const std::string_view &from)
 Converts the contents of a std::string_view to a boolean.
 
static std::optional< bool > convert (std::string_view)
 Converts between TFrom and TTo where no actual conversion is defined, returning std::nullopt.
 

Detailed Description

Converts from std::string_view to a bool.

Definition at line 63 of file MetadataConversions.h.

Member Function Documentation

◆ convert() [1/2]

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

Converts the contents of a std::string_view 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_view to convert from.

Definition at line 89 of file MetadataConversions.h.

◆ convert() [2/2]

static std::optional< bool > CesiumGltf::MetadataConversions< bool, std::string_view, void >::convert ( std::string_view )
inlinestatic

Converts between TFrom and TTo where no actual conversion is defined, returning std::nullopt.

Definition at line 26 of file MetadataConversions.h.


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