Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
t
u
v
w
Functions
_
c
d
g
m
o
p
r
t
v
w
Variables
_
a
c
d
e
f
h
i
k
l
m
n
p
r
u
v
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
m
o
p
r
s
t
u
v
w
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
Typedefs
a
b
c
d
e
f
g
h
i
l
m
o
p
q
r
s
t
u
v
w
x
y
Enumerations
_
a
b
d
e
f
g
h
i
j
l
m
p
s
u
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
src
util.h
Go to the documentation of this file.
1
/*
2
* Copyright 2021, Rein Appeldoorn
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
*/
17
18
#pragma once
19
20
#include <map>
21
#include <sstream>
22
#include <string>
23
#include <vector>
24
25
namespace
picovoice_driver
26
{
27
template
<
typename
T>
28
std::string
toString
(
const
T& v)
29
{
30
std::stringstream ss;
31
ss << v;
32
return
ss.str();
33
}
34
35
template
<
typename
T>
36
std::string
toString
(
const
std::vector<T>& v)
37
{
38
std::stringstream ss;
39
ss <<
"{"
;
40
for
(
size_t
i = 0; i < v.size(); ++i)
41
{
42
if
(i != 0)
43
{
44
ss <<
", "
;
45
}
46
ss << v[i];
47
}
48
ss <<
"}"
;
49
return
ss.str();
50
}
51
52
template
<
typename
T1,
typename
T2>
53
std::string
toString
(
const
std::map<T1, T2>& v)
54
{
55
std::stringstream ss;
56
ss <<
"{"
;
57
bool
first =
true
;
58
for
(
const
auto
& kv : v)
59
{
60
if
(first)
61
{
62
first =
false
;
63
}
64
else
65
{
66
ss <<
", "
;
67
}
68
ss << kv.first <<
"="
<< kv.second;
69
}
70
ss <<
"}"
;
71
return
ss.str();
72
}
73
}
// namespace picovoice_driver
picovoice_driver
Definition:
porcupine_node.cpp:24
picovoice_driver::toString
std::string toString(const T &v)
Definition:
util.h:28
picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:55