20 #include "XrdkCentralComRFC.h"
22 #include "hostIf_utils.h"
26 const char *TR181_RFC_STORE_KEY =
"TR181_STORE_FILENAME";
27 const char *RFC_PROPERTIES_FILE =
"/etc/rfc.properties";
29 XRFCStorage::XRFCStorage()
31 m_storageLoaded =
false;
34 void XRFCStorage::clearAll()
47 const std::string ¶mValue = m_storage.value(stMsgData->
paramName);
48 ret = paramValue.empty() ? NOK : OK;
64 putValue(stMsgData, paramValue);
76 const string &valueString = getStringValue(stMsgData);
78 const string &oldValue = m_storage.value(stMsgData->
paramName);
81 if (oldValue == valueString) {
87 if ((m_storage.setValue(stMsgData->
paramName, valueString))) {
93 string XRFCStorage::getRawValue(
const string &key)
99 return m_storage.value(key);
102 bool XRFCStorage::setRawValue(
const string &key,
const string &value)
108 return m_storage.setValue(key, value);
112 bool XRFCStorage::init()
114 if (m_storageLoaded) {
120 file.load(RFC_PROPERTIES_FILE);
121 m_storageFile = file.value(TR181_RFC_STORE_KEY);
123 if (m_storageFile.empty()) {
124 RDK_LOG(RDK_LOG_INFO,LOG_TR69HOSTIF,
"Looks like %s doesn't contain the key %s\n", __FUNCTION__, __LINE__, RFC_PROPERTIES_FILE, TR181_RFC_STORE_KEY);
128 m_storage.load(m_storageFile);
130 m_storageLoaded =
true;