22 m_currentPropertyValues(),
23 m_outputMap(outputMap),
24 m_propCodeManager(pcm)
36 string stringName=name.toUtf8().data();
37 if (stringName ==
"code")
41 LDEBUG <<
"write code " << m_currentCode;
43 if (m_outputMap.find(m_currentCode)!=m_outputMap.end()) {
45 LWARN << m_currentCode <<
" already exists! overwrite it";
47 m_outputMap[m_currentCode]=m_propCodeManager.
encode(m_currentPropertyValues);
59 string stringName=name.toUtf8().data();
60 if (stringName ==
"code")
62 m_currentCode=attributes.value(
"key").toUtf8().data();
63 m_currentPropertyValues.clear();
65 LDEBUG <<
"read code " << m_currentCode;
68 else if (stringName ==
"field")
70 string key=attributes.value(
"key").toUtf8().data();
71 string value=attributes.value(
"value").toUtf8().data();
73 LDEBUG <<
"read field key=" << key <<
" value=" << value;
77 m_currentPropertyValues[key]=value;
#define PROPERTYCODELOGINIT
Provide tools to parse a property file, and deal with the property coding system.
LinguisticCode encode(const std::map< std::string, std::string > &propValues) const
Compute the code corresponding to given the properties/values.
bool startElement(const QString &namespaceURI, const QString &name, const QString &qName, const QXmlAttributes &attributes) override
virtual ~SymbolicCodeXMLHandler()
SymbolicCodeXMLHandler(const Lima::Common::PropertyCode::PropertyCodeManager &pcm, std::map< std::string, Lima::LinguisticCode > &outputMap)
bool endElement(const QString &namespaceURI, const QString &name, const QString &qName) override