ESP-IDF
ot::Stringify
is only used within ESP-IDF.
Symbol previews are coming soon...
Symbols
loading...
Files
loading...
Summary
Syntax
Methods
Examples
References
Call Tree
Data Use
Class Tree
Override Tree
Implementations
Instances
Lifecycle
SourceVu
ESP-IDF Framework and Examples
ESP-IDF
ot::Stringify
ot::Stringify class
Provides helper methods to convert from a set of `uint16_t` values (e.g., a non-sequential `enum`) to string using binary search in a lookup table.
Syntax
Show:
Summary
Declaration
from
string.hpp:513
class
Stringify
:
public
BinarySearch
{
public
:
class
Entry
{
friend
class
BinarySearch
;
public
:
uint16_t
mKey
;
const
char
*
mString
;
private
:
int
Compare
(
uint16_t
aKey
)
const
{
return
ThreeWayCompare
(
aKey
,
mKey
)
;
}
constexpr
static
bool
AreInOrder
(
const
Entry
&
aFirst
,
const
Entry
&
aSecond
)
{
return
aFirst
.
mKey
<
aSecond
.
mKey
;
}
}
;
template
<
uint16_t
kLength
>
static
const
char
*
Lookup
(
uint16_t
aKey
,
const
Entry
(
&
aTable
)
[
kLength
]
,
const
char
*
aNotFound
=
"unknown"
)
{
const
Entry
*
entry
=
BinarySearch
::
Find
(
aKey
,
aTable
)
;
return
(
entry
!=
nullptr
)
?
entry
->
mString
:
aNotFound
;
}
Stringify
(
void
)
=
delete
;
}
;
Methods
Lookup()
Lookup
Examples
References
from
examples
Call Tree
from
examples
All items filtered out
All items filtered out
Data Use
from
examples
All items filtered out
All items filtered out
Class Tree
from
examples
All items filtered out
All items filtered out
Override Tree
from
examples
All items filtered out
All items filtered out
Implementations
from
examples
All items filtered out
All items filtered out
Instances
from
examples
Lifecycle
from
examples
All items filtered out
All items filtered out