You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/06/21 17:37:31 UTC

[GitHub] [trafficserver] jrushford commented on a change in pull request #7948: Improve parsing error messages for strategies.yaml.

jrushford commented on a change in pull request #7948:
URL: https://github.com/apache/trafficserver/pull/7948#discussion_r655576847



##########
File path: mgmt/YamlCfg.h
##########
@@ -0,0 +1,77 @@
+/** @file
+
+  Utilites to help with parsing YAML files with good error reporting.
+
+  @section license License
+
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ */
+
+#pragma once
+
+#include <vector>
+#include <string_view>
+
+#include <yaml-cpp/yaml.h>
+
+namespace ts
+{
+namespace Yaml
+{
+  // A class that is a wrapper for a YAML::Node that corresponds to a map in a YAML input file.
+  // It's purpose is to make sure all keys in the map are processed.
+  //
+  class Map
+  {
+  public:
+    // A YAML::ParserException will be thrown if 'map' isn't actually a map.
+    //
+    explicit Map(YAML::Node map);
+
+    // Get the node for a key.  Throw a YAML::Exception if 'key' is not in the map.  The node for each key in the
+    // map must be gotten at least once.  The lifetime of he char array referenced by passed key must be as long

Review comment:
       Spelling, "The lifetime of **the**"




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org