mirror of
				https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
				synced 2025-10-30 18:17:50 +00:00 
			
		
		
		
	chore(LocalConfigurationView): fix style #3529
This commit is contained in:
		| @@ -20,9 +20,10 @@ | ||||
| #include "Poco/Util/Util.h" | ||||
|  | ||||
| namespace Poco { | ||||
|     namespace Util { | ||||
| namespace Util { | ||||
|  | ||||
|         class Util_API LocalConfigurationView : public AbstractConfiguration | ||||
|  | ||||
| class Util_API LocalConfigurationView : public AbstractConfiguration | ||||
| 	/// This configuration implements a "view" into a sub-hierarchy | ||||
| 	/// of another configuration. | ||||
| 	/// | ||||
| @@ -42,31 +43,29 @@ namespace Poco { | ||||
| 	/// LayeredConfiguration. | ||||
| 	/// | ||||
| 	/// The LocalConfigurationView only searches for the properties in the viewed Space. | ||||
|         { | ||||
|            public: | ||||
| { | ||||
| public: | ||||
| 	LocalConfigurationView(const std::string& prefix, AbstractConfiguration::Ptr pConfig); | ||||
| 		/// Creates the LocalConfigurationView. The LocalConfigurationView | ||||
| 		/// retains (shared) ownership of the passed configuration. | ||||
|  | ||||
|            protected: | ||||
| protected: | ||||
| 	bool getRaw(const std::string& key, std::string& value) const; | ||||
| 	void setRaw(const std::string& key, const std::string& value); | ||||
| 	void enumerate(const std::string& key, Keys& range) const; | ||||
| 	void removeRaw(const std::string& key); | ||||
|  | ||||
| 	std::string translateKey(const std::string& key) const; | ||||
|  | ||||
| 	~LocalConfigurationView(); | ||||
|  | ||||
|            private: | ||||
| private: | ||||
| 	LocalConfigurationView(const LocalConfigurationView&); | ||||
| 	LocalConfigurationView& operator=(const LocalConfigurationView&); | ||||
|  | ||||
| 	std::string _prefix; | ||||
| 	AbstractConfiguration::Ptr _pConfig; | ||||
|         }; | ||||
| }; | ||||
|  | ||||
|  | ||||
| }} // namespace Poco::Util | ||||
|  | ||||
|     }  // namespace Util | ||||
| }  // namespace Poco | ||||
|  | ||||
| #endif  // Util_LocalConfigurationView_INCLUDED | ||||
|   | ||||
| @@ -13,43 +13,58 @@ | ||||
|  | ||||
| #include "Poco/Util/LocalConfigurationView.h" | ||||
|  | ||||
|  | ||||
| namespace Poco { | ||||
|     namespace Util { | ||||
| namespace Util { | ||||
|  | ||||
|         LocalConfigurationView::LocalConfigurationView(const std::string& prefix, AbstractConfiguration::Ptr pConfig) : _prefix(prefix), | ||||
|                                                                                                                         _pConfig(pConfig) { | ||||
|  | ||||
| LocalConfigurationView::LocalConfigurationView(const std::string& prefix, AbstractConfiguration::Ptr pConfig) : | ||||
| 	_prefix(prefix), _pConfig(pConfig) | ||||
| { | ||||
| 	poco_check_ptr(pConfig); | ||||
|         } | ||||
| } | ||||
|  | ||||
|         LocalConfigurationView::~LocalConfigurationView() { | ||||
|         } | ||||
|  | ||||
|         bool LocalConfigurationView::getRaw(const std::string& key, std::string& value) const { | ||||
| LocalConfigurationView::~LocalConfigurationView() | ||||
| { | ||||
| } | ||||
|  | ||||
|  | ||||
| bool LocalConfigurationView::getRaw(const std::string& key, std::string& value) const | ||||
| { | ||||
| 	std::string translatedKey = translateKey(key); | ||||
| 	return _pConfig->getRaw(translatedKey, value); | ||||
|         } | ||||
| } | ||||
|  | ||||
|         void LocalConfigurationView::setRaw(const std::string& key, const std::string& value) { | ||||
|  | ||||
| void LocalConfigurationView::setRaw(const std::string& key, const std::string& value) | ||||
| { | ||||
| 	std::string translatedKey = translateKey(key); | ||||
| 	_pConfig->setRaw(translatedKey, value); | ||||
|         } | ||||
| } | ||||
|  | ||||
|         void LocalConfigurationView::enumerate(const std::string& key, Keys& range) const { | ||||
|  | ||||
| void LocalConfigurationView::enumerate(const std::string& key, Keys& range) const | ||||
| { | ||||
| 	std::string translatedKey = translateKey(key); | ||||
| 	_pConfig->enumerate(translatedKey, range); | ||||
|         } | ||||
| } | ||||
|  | ||||
|         void LocalConfigurationView::removeRaw(const std::string& key) { | ||||
|  | ||||
| void LocalConfigurationView::removeRaw(const std::string& key) | ||||
| { | ||||
| 	std::string translatedKey = translateKey(key); | ||||
| 	_pConfig->remove(translatedKey); | ||||
|         } | ||||
| } | ||||
|  | ||||
|         std::string LocalConfigurationView::translateKey(const std::string& key) const { | ||||
|  | ||||
| std::string LocalConfigurationView::translateKey(const std::string& key) const | ||||
| { | ||||
| 	std::string result = _prefix; | ||||
| 	if (!result.empty() && !key.empty() && key[0] != '[') result += '.'; | ||||
| 	result += key; | ||||
| 	return result; | ||||
|         } | ||||
| } | ||||
|  | ||||
|     }  // namespace Util | ||||
| }  // namespace Poco | ||||
|  | ||||
| }}  // namespace Poco::Util | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Alex Fabijanic
					Alex Fabijanic