-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathurioptionreader.cpp
More file actions
43 lines (40 loc) · 909 Bytes
/
Copy pathurioptionreader.cpp
File metadata and controls
43 lines (40 loc) · 909 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
#include "urioptionreader.h"
#include "utils.h"
#include <vector>
#include <boost/algorithm/string.hpp>
/*
using namespace boost;
using namespace std;
UriOptionReader::UriOptionReader(const string& uri) : m_uri(uri)
{
//ctor
}
void UriOptionReader::doReadOptions(std::map<std::string, std::string>& values)
{
string key, value;
bool keyFound = false;
size_t l = m_uri.length();
for (size_t i = 0; i < l; i++)
{
char c = m_uri[i];
if (!keyFound)
{
if (c == '=')
keyFound = true;
else
key += c;
}
else
{
if (c == '&')
{
values[key] = value;//utils::decodeUri(value);
key.clear();
value.clear();
keyFound = false;
}
else
value += c;
}
}
}*/