mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-20 16:40:35 +00:00
The parameters in the request holds the path parameters. The current implementation based on unorder_map has a few downside: 1. Because path parameters are sometime used to mark a file path and they can extend to multiple url section (may contain /) the value will always contain the leading slash. Though this is true for files, for the common case, it would be easier to return the value without it. 2. The []operator of the hash map is non const, this mean that it cannot be used in the common case where the request object is passed as a const reference. 3. There is no exists method in an ordered_map - Usually query parameters are mandatory, still it is usefull to have an easy way of testing if a parameter is found. This series wrap the unordered_map implementation in a manner more suitable for the request. The [] operator will be const and retrun a copy of the parameter value without the leading slash. The at method will keep the old meaning. For clearer code, a path method was added to indicate that the return value has a leading slash. A set method is used for assignment. Older code will continue to work without changes. Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>