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.
43 * ex) http://user:password@www.google.co.kr:8080/market/Item?12345
44 * url_ = http://user:password@www.google.co.kr:8080/market/Item?12345
46 * domain_ = user:password@www.google.co.kr
48 * path_ = /market/Item?12345
52 explicit URL(const std::string& url);
55 std::string url() const;
56 std::string scheme() const;
57 std::string domain() const;
59 std::string path() const;
67 #endif // XWALK_COMMON_URL_H_