Class Configuration

Synopsis

#include <src/easylogging++.h>

class Configuration : public Loggable

Description

Represents single configuration that has representing level, configuration type and a string based value.

@detail String based value means any value either its boolean, integer or string itself, it will be embedded inside quotes and will be parsed later.

Consider some examples below:

Mentioned in

Inheritance

Ancestors: Loggable

Classes

PredicateUsed to find configuration from configuration (pointers) repository. Avoid using it.

Methods

Configuration overloadConfiguration.
Configuration overloadFull constructor used to sets value of configuration.
~Configuration
configurationTypeGets configuration type of current configuration.
levelGets level of current configuration.
log
operator=
setValueSet string based configuration value.
valueGets string based configuration value.

Source

Lines 1677-1728 in src/easylogging++.h.

class Configuration : public Loggable {
 public:
  Configuration(const Configuration& c);
  Configuration& operator=(const Configuration& c);

  virtual ~Configuration(void) {
  }

  /// @brief Full constructor used to sets value of configuration
  Configuration(Level level, ConfigurationType configurationType, const std::string& value);

  /// @brief Gets level of current configuration
  inline Level level(void) const {
    return m_level;
  }

  /// @brief Gets configuration type of current configuration
  inline ConfigurationType configurationType(void) const {
    return m_configurationType;
  }

  /// @brief Gets string based configuration value
  inline const std::string& value(void) const {
    return m_value;
  }

  /// @brief Set string based configuration value
  /// @param value Value to set. Values have to be std::string; For boolean values use "true", "false", for any integral values
  ///        use them in quotes. They will be parsed when configuring
  inline void setValue(const std::string& value) {
    m_value = value;
  }

  virtual void log(el::base::type::ostream_t& os) const;

  /// @brief Used to find configuration from configuration (pointers) repository. Avoid using it.
  class Predicate {
   public:
    Predicate(Level level, ConfigurationType configurationType);

    bool operator()(const Configuration* conf) const;

   private:
    Level m_level;
    ConfigurationType m_configurationType;
  };

 private:
  Level m_level;
  ConfigurationType m_configurationType;
  std::string m_value;
};





Add Discussion

Log in to comment