Merge "Patch 1 : Adding Arduino WiFi support. This requires updated Arduino WiFi...
[platform/upstream/iotivity.git] / include / OCUtilities.h
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 #ifndef _INTEL_OCUTILITIES_H_
22 #define _INTEL_OCUTILITIES_H_
23 #endif
24
25 #include <map>
26 #include <vector>
27 #include <memory>
28 #include <exception>
29
30 namespace OC {
31     namespace Utilities {
32
33         typedef std::map<std::string, std::string> QueryParamsKeyVal;
34         /*
35          * @brief Helper function to get query parameter from a URI
36          * @remarks      Its okay to return a copy of the container.\
37          *               The size is not expected to be huge.
38          * @remarks      Temporary: The URI must strictly have\
39          *               coap as the protocol in the fully qualified URI\
40          *               e.g., coap://1.2.3.4:5657/foo?bar=0)
41          * @remarks      If a separate class for URI parser is needed,\
42          *               please talk to Erich Keane.
43          * @todo         If more URI elements need to be parsed,\
44          *               please move the common parsing logic to a
45          *               different function
46          */
47         QueryParamsKeyVal getQueryParams(const std::string& uri);
48
49     }
50 }