Botan 3.11.0
Crypto and TLS for C&
cpuid_features.cpp
Go to the documentation of this file.
1/**
2* (C) 2025 Jack Lloyd
3* (C) 2025 polarnis
4*
5* Botan is released under the Simplified BSD License (see license.txt)
6*/
7
8#include <botan/internal/cpuid_features.h>
9
10#include <botan/exceptn.h>
11
12namespace Botan {
13
14std::string CPUFeature::to_string() const {
15 switch(m_bit) {
16 case CPUFeature::Bit::SIMD128:
17 return "simd128";
18 }
19 throw Invalid_State("CPUFeature invalid bit");
20}
21
22//static
23std::optional<CPUFeature> CPUFeature::from_string(std::string_view tok) {
24 if(tok == "simd128") {
25 return CPUFeature::Bit::SIMD128;
26 }
27
28 return {};
29}
30
31} // namespace Botan
static std::optional< CPUFeature > from_string(std::string_view)
Definition cpuid.cpp:24
std::string to_string() const
Definition cpuid.cpp:28