forked from alonf/WebControlledSwitch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtil.cpp
More file actions
49 lines (41 loc) · 763 Bytes
/
Copy pathUtil.cpp
File metadata and controls
49 lines (41 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
//
//
#include "Util.h"
using namespace std;
namespace Util
{
/*int findChar(const String& str, char c, int from, int to)
{
while (from < to)
{
if (str[from] == c)
break;
++from;
}
return from;
}*/
void software_Reboot() //rebot the board
{
ESP.restart();
}
String& StringMap::at(const String& key)
{
for (int i = 0; i < _vector.size(); ++i)
{
if (_vector[i].first == key) //found
return _vector[i].second;
}
_vector.push_back(pair<String, String>(key, String()));
return _vector.rbegin()->second;
}
const String& StringMap::at(const String& key) const
{
for (int i = 0; i < _vector.size(); ++i)
{
if (_vector[i].first == key) //found
return _vector[i].second;
}
return String();
}
}