//
///////////////////////////////////////////////////////////////////
- std::string Message::text() const
+ TranslatedText Message::text() const
{ return pimpl().text(); }
- std::string Message::type() const
- { return pimpl().type(); }
-
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
public:
/** Get the text of the message */
- std::string text() const;
- /** Get the type of the message (YesNo / OK) */
- std::string type() const;
+ TranslatedText text() const;
protected:
Message( const NVRAD & nvrad_r );
MessageImpl::~MessageImpl()
{}
- std::string MessageImpl::type() const {
- return _type;
- }
-
- std::string MessageImpl::text() const {
+ TranslatedText MessageImpl::text() const {
return _text;
}
public:
/** Get the text of the message */
- virtual std::string text() const;
- /** Get the type of the message (YesNo / OK) */
- virtual std::string type() const;
+ virtual TranslatedText text() const;
protected:
/** The text of the message */
- std::string _text;
- /** The type of the message (YesNo / OK) */
- std::string _type;
+ TranslatedText _text;
};
///////////////////////////////////////////////////////////////////
public:
/** Get the text of the message */
- virtual std::string text() const = 0;
- /** Get the type of the message (YesNo / OK) */
- virtual std::string type() const = 0;
+ virtual TranslatedText text() const = 0;
/** */
virtual ByteCount size() const;
};
{
out << "Message Data: " << endl
<< " name: " << data.name << endl
- << " type: " << data.type << endl
<< " epoch: " << data.epoch << endl
<< " version: " << data.ver << endl
<< " release: " << data.rel << endl
public:
YUMPatchMessage() {};
virtual AtomType atomType() { return Message; };
- std::string type;
- std::string text;
+ TranslatedText text;
};
xmlNodePtr formatNode)
{
shared_ptr<YUMPatchMessage> message(new YUMPatchMessage);
- message->type = _helper.attribute(formatNode,"type");
// FIXME move the respective method to a common class, inherit it
YUMPrimaryParser prim;
if (_helper.isElement(child)) {
string name = _helper.name(child);
if (name == "name") {
- message->name = _helper.content(child);
+ message->name = _helper.content(child);
}
else if (name == "version") {
message->epoch = _helper.attribute(child,"epoch");
message->rel = _helper.attribute(child,"rel");
}
else if (name == "text") {
- message->text = _helper.content(child);
+ message->text.setText(_helper.content(child), Locale(_helper.attribute(child,"lang")));
}
else if (name == "provides") {
prim.parseDependencyEntries(& message->provides, child);
element message {
element-name,
element-version,
- attribute type { "OK" | "YesNo" },
- element text { xsd:string },
+ element text { localized-string }+,
dependency-block
}
<element name="message">
<ref name="element-name"/>
<ref name="element-version"/>
- <attribute name="type">
- <choice>
- <value>OK</value>
- <value>YesNo</value>
- </choice>
- </attribute>
- <element name="text">
- <data type="string"/>
- </element>
+ <oneOrMore>
+ <element name="text">
+ <ref name="localized-string"/>
+ </element>
+ </oneOrMore>
<ref name="dependency-block"/>
</element>
</define>
: _source(source_r)
{
_text = parsed.text;
- _type = parsed.type;
}
/** Get the text of the message */
- std::string YUMMessageImpl::text() const {
+ TranslatedText YUMMessageImpl::text() const {
return _text;
}
- /** Get the type of the message (YesNo / OK) */
- std::string YUMMessageImpl::type() const {
- return _type;
- }
TranslatedText YUMMessageImpl::summary() const
{ return ResObjectImplIf::summary(); }
const zypp::parser::yum::YUMPatchMessage & parsed
);
/** Get the text of the message */
- virtual std::string text() const;
- /** Get the type of the message (YesNo / OK) */
- virtual std::string type() const;
+ virtual TranslatedText text() const;
/** */
virtual TranslatedText summary() const;
/** */
protected:
/** The text of the message */
- std::string _text;
- /** The type of the message (YesNo / OK) */
- std::string _type;
+ TranslatedText _text;
private:
Source_Ref _source;
public:
try
{
shared_ptr<XMLMessageImpl> impl(new XMLMessageImpl());
- impl->_type = parsed.type;
impl->_text = parsed.text;
// Collect basic Resolvable data
std::string toXML( const Message::constPtr &obj )
{
stringstream out;
- out << "<message type=\"" << obj->type() << "\">" << std::endl;
+ out << "<message>" << std::endl;
// reuse Resolvable information serialize function
out << toXML(static_cast<Resolvable::constPtr>(obj));
out << " <text>" << obj->text() << "</text>" << std::endl;
XMLMessageImpl::~XMLMessageImpl()
{}
- std::string XMLMessageImpl::type() const {
- return _type;
- }
-
- std::string XMLMessageImpl::text() const {
+ TranslatedText XMLMessageImpl::text() const {
return _text;
}
virtual ~XMLMessageImpl();
/** Get the text of the message */
- virtual std::string text() const;
- /** Get the type of the message (YesNo / OK) */
- virtual std::string type() const;
+ virtual TranslatedText text() const;
/** The text of the message */
- std::string _text;
- /** The type of the message (YesNo / OK) */
- std::string _type;
+ TranslatedText _text;
};
///////////////////////////////////////////////////////////////////