File: config_document_factory.hpp

package info (click to toggle)
cpp-hocon 0.3.0-1.2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,320 kB
  • sloc: cpp: 12,223; makefile: 4
file content (39 lines) | stat: -rw-r--r-- 1,381 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include "config_document.hpp"
#include <hocon/config_parse_options.hpp>
#include "../export.h"

/**
 * Factory for creating config_document instances.
 */
namespace hocon { namespace config_document_factory {

    /**
     * Parses a file into a config_document instance.
     *
     * @param file
     *       the file to parse
     * @param options
     *       parse options to control how the file is interpreted
     * @return the parsed configuration
     */
    LIBCPP_HOCON_EXPORT std::shared_ptr<config_document> parse_file(std::string input_file_path,
                                                                    config_parse_options options);

    /** Parses a file into a config_document instance using default options. */
    LIBCPP_HOCON_EXPORT std::shared_ptr<config_document> parse_file(std::string input_file_path);

    /**
     * Parses a string which should be valid HOCON or JSON.
     *
     * @param s string to parse
     * @param options parse options
     * @return the parsed configuration
     */
    LIBCPP_HOCON_EXPORT std::shared_ptr<config_document> parse_string(std::string s, config_parse_options options);

    /** Parses a string into a config_document instance using default options. */
    LIBCPP_HOCON_EXPORT std::shared_ptr<config_document> parse_string(std::string s);

}}  // namespace hocon::config_document_factory