1 /*
2  * YamlUtil.hpp
3  *
4  * Copyright (C) 2021 by RStudio, PBC
5  *
6  * Unless you have received this program directly from RStudio pursuant
7  * to the terms of a commercial license agreement with RStudio, then
8  * this program is licensed to you under the terms of version 3 of the
9  * GNU Affero General Public License. This program is distributed WITHOUT
10  * ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THOSE OF NON-INFRINGEMENT,
11  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Please refer to the
12  * AGPL (http://www.gnu.org/licenses/agpl-3.0.txt) for more details.
13  *
14  */
15 
16 #ifndef CORE_YAML_UTIL_HPP
17 #define CORE_YAML_UTIL_HPP
18 
19 #include <string>
20 
21 namespace rstudio {
22 namespace core {
23 
24 class Error;
25 class FilePath;
26 
27 namespace yaml {
28 
29 bool hasYamlHeader(const core::FilePath& filePath);
30 bool hasYamlHeader(const std::string& content);
31 
32 std::string extractYamlHeader(const core::FilePath& filePath);
33 std::string extractYamlHeader(const std::string& content);
34 
35 } // namespace yaml
36 } // namespace core
37 } // namespace rstudio
38 
39 #endif /* CORE_YAML_UTIL_HPP */
40