mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
Implement source_location attribute for the ConfigObject class
refs #5120
This commit is contained in:
parent
dae8a4bac5
commit
0f81c357c0
@ -710,5 +710,18 @@ ConfigObject::Ptr ConfigObject::GetZone(void) const
|
|||||||
return m_Zone;
|
return m_Zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Dictionary::Ptr ConfigObject::GetSourceLocation(void) const
|
||||||
|
{
|
||||||
|
DebugInfo di = GetDebugInfo();
|
||||||
|
|
||||||
|
Dictionary::Ptr result = new Dictionary();
|
||||||
|
result->Set("path", di.Path);
|
||||||
|
result->Set("first_line", di.FirstLine);
|
||||||
|
result->Set("first_column", di.FirstColumn);
|
||||||
|
result->Set("last_line", di.LastLine);
|
||||||
|
result->Set("last_column", di.LastColumn);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
NameComposer::~NameComposer(void)
|
NameComposer::~NameComposer(void)
|
||||||
{ }
|
{ }
|
||||||
|
@ -75,6 +75,8 @@ public:
|
|||||||
virtual void OnAllConfigLoaded(void);
|
virtual void OnAllConfigLoaded(void);
|
||||||
virtual void OnStateLoaded(void);
|
virtual void OnStateLoaded(void);
|
||||||
|
|
||||||
|
virtual Dictionary::Ptr GetSourceLocation(void) const override;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
static intrusive_ptr<T> GetObject(const String& name)
|
static intrusive_ptr<T> GetObject(const String& name)
|
||||||
{
|
{
|
||||||
|
@ -85,6 +85,9 @@ abstract class ConfigObject : ConfigObjectBase < ConfigType
|
|||||||
[config, no_user_modify] name(Zone) zone (ZoneName);
|
[config, no_user_modify] name(Zone) zone (ZoneName);
|
||||||
[config, no_user_modify] String package;
|
[config, no_user_modify] String package;
|
||||||
[config, get_protected, no_user_modify] Array::Ptr templates;
|
[config, get_protected, no_user_modify] Array::Ptr templates;
|
||||||
|
[config, no_storage, no_user_modify] Dictionary::Ptr source_location {
|
||||||
|
get;
|
||||||
|
};
|
||||||
[get_protected, no_user_modify] bool active;
|
[get_protected, no_user_modify] bool active;
|
||||||
[get_protected, no_user_modify] bool paused {
|
[get_protected, no_user_modify] bool paused {
|
||||||
default {{{ return true; }}}
|
default {{{ return true; }}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user