// Licensed to the Software Freedom Conservancy (SFC) under one1// or more contributor license agreements. See the NOTICE file2// distributed with this work for additional information3// regarding copyright ownership. The SFC licenses this file4// to you 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 at7//8// http://www.apache.org/licenses/LICENSE-2.09//10// Unless required by applicable law or agreed to in writing, software11// 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 and14// limitations under the License.1516// Defines the server to respond to WebDriver JSON wire protocol commands.17// Subclasses are expected to provide their own initialization mechanism.1819#ifndef WEBDRIVER_SERVER_URI_INFO_H_20#define WEBDRIVER_SERVER_URI_INFO_H_2122#include <map>23#include <string>24#include <vector>2526namespace webdriver {2728class UriInfo {29public:30UriInfo(const std::string& uri,31const std::string& verb,32const std::string& command_name);3334static void ParseUri(const std::string& uri,35std::vector<std::string>* fragments,36std::vector<size_t>* parameter_indexes);3738bool IsUriMatch(const std::vector<std::string>& uri_fragments,39std::vector<std::string>* uri_param_names,40std::vector<std::string>* uri_param_values);41bool HasHttpVerb(const std::string& http_verb, std::string* command_name);42std::string GetSupportedVerbs(void);43void AddHttpVerb(const std::string& http_verb,44const std::string& command_name);4546private:47typedef std::map<std::string, std::string> HttpVerbMap;4849bool IsValidParameterValue(const std::string& param_name,50const std::string& param_value);5152std::vector<std::string> fragments_;53std::vector<size_t> parameter_indexes_;54HttpVerbMap verb_map_;5556DISALLOW_COPY_AND_ASSIGN(UriInfo);57};5859} // namespace WebDriver6061#endif // WEBDRIVER_SERVER_URI_INFO_H_626364