// Accessors
inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;}
inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;}
+ inline const char *Display() const {return S->Display == 0?0:Owner->StrP + S->Display;}
/** \brief source package name this version comes from
Always contains the name, even if it is the same as the binary name */
inline const char *SourcePkgName() const {return Owner->StrP + S->SourcePkgName;}
const char *Start;
const char *Stop;
+ if (Section.Find("Name",Start,Stop) == true)
+ {
+ Ver->Display = WriteString(Start, Stop - Start);
+ }
+ else if (Section.Find("Maemo-Display-Name",Start,Stop) == true)
+ {
+ Ver->Display = WriteString(Start, Stop - Start);
+ }
+
// Parse the section
if (Section.Find(pkgTagSection::Key::Section,Start,Stop) == true)
{
return Result;
}
/*}}}*/
+// RecordParserBase::Display - Return the package homepage /*{{{*/
+string debRecordParserBase::Display()
+{
+ string display(Section.FindS("Name"));
+ if (display.empty())
+ display = Section.FindS("Maemo-Display-Name");
+ return display;
+}
+ /*}}}*/
// RecordParserBase::Homepage - Return the package homepage /*{{{*/
string debRecordParserBase::Homepage()
{
virtual std::string ShortDesc(std::string const &lang) APT_OVERRIDE;
virtual std::string LongDesc(std::string const &lang) APT_OVERRIDE;
virtual std::string Name() APT_OVERRIDE;
+ virtual std::string Display() APT_OVERRIDE;
virtual std::string Homepage() APT_OVERRIDE;
// An arbitrary custom field
map_stringitem_t VerStr;
/** \brief section this version is filled in */
map_stringitem_t Section;
+ /** \brief high-level name used to display package */
+ map_stringitem_t Display;
/** \brief source package name this version comes from
Always contains the name, even if it is the same as the binary name */
map_stringitem_t SourcePkgName;
std::string LongDesc() {return LongDesc("");};
virtual std::string Name() {return std::string();};
+ virtual std::string Display() {return std::string();}
virtual std::string Homepage() {return std::string();}
// An arbitrary custom field