File: config_null.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 (33 lines) | stat: -rw-r--r-- 1,044 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
#pragma once

#include <hocon/config_value.hpp>
#include <internal/simple_config_origin.hpp>

#include <string>

namespace hocon {

    /**
     * This exists because sometimes null is not the same as missing. Specifically,
     * if a value is set to null we can give a better error message (indicating
     * where it was set to null) in case someone asks for the value. Also, null
     * overrides values set "earlier" in the search path, while missing values do
     * not.
     */
    class config_null : public config_value {
    public:
        config_null(shared_origin origin);

        config_value::type value_type() const override;
        std::string transform_to_string() const override;

        unwrapped_value unwrapped() const override;

        bool operator==(config_value const& other) const override;

    protected:
        shared_value new_copy(shared_origin) const override;
        void render(std::string& result, int indent, bool at_root, config_render_options options) const override;
    };

}  // namespace hocon