mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-07 06:09:42 +00:00
+ i2p::config::IsDefault
This commit is contained in:
11
Config.cpp
11
Config.cpp
@@ -223,6 +223,15 @@ namespace config {
|
|||||||
|
|
||||||
void Finalize() {
|
void Finalize() {
|
||||||
notify(m_Options);
|
notify(m_Options);
|
||||||
};
|
}
|
||||||
|
|
||||||
|
bool IsDefault(const char *name) {
|
||||||
|
if (!m_Options.count(name))
|
||||||
|
throw "try to check non-existent option";
|
||||||
|
|
||||||
|
if (m_Options[name].defaulted())
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} // namespace config
|
} // namespace config
|
||||||
} // namespace i2p
|
} // namespace i2p
|
||||||
|
|||||||
7
Config.h
7
Config.h
@@ -94,6 +94,13 @@ namespace config {
|
|||||||
notify(m_Options);
|
notify(m_Options);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check is value explicitly given or default
|
||||||
|
* @param name Name of checked parameter
|
||||||
|
* @return true if value set to default, false othervise
|
||||||
|
*/
|
||||||
|
bool IsDefault(const char *name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user