2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef XWALK_COMMON_URL_H_
18 #define XWALK_COMMON_URL_H_
27 * This class parses a given url based on its scheme type.
28 * The parsed data is stored in different variables depending on the scheme
30 * The following shows the variables which are used for each scheme type:
31 * http:// https:// ssh:// ftp://
32 * => url_, scheme_, domain_, port_, path_
34 * => url_, scheme_, domain_, path_
36 * => url_, scheme_, path_
40 * If the url does not have specific data, an empty string will be stored
41 * in the corresponding variables.(RFC 1738)
43 * ex) http://user:password@www.tizen.org:8080/market/Item?12345
44 * url_ = http://user:password@www.tizen.org:8080/market/Item?12345
47 * password_ = password
48 * domain_ = www.tizen.org
50 * path_ = /market/Item?12345
54 explicit URL(const std::string& url);
57 std::string url() const;
58 std::string scheme() const;
59 std::string domain() const;
61 std::string path() const;
69 #endif // XWALK_COMMON_URL_H_