CT_WITHIN = 1,
CT_LABELSTRING,
CT_LABELSTRING_APPENDIX,
+ CT_PRETTYFORMAT,
CT_END
};
{ "end", CT_END },
{ "labelstring", CT_LABELSTRING },
{ "labelstringappendix", CT_LABELSTRING_APPENDIX },
+ { "prettyformat", CT_PRETTYFORMAT },
{ "within", CT_WITHIN }
};
if (master_ == "none")
master_.erase();
break;
+ case CT_PRETTYFORMAT:
+ lex.next();
+ prettyformat_ = lex.getDocString();
+ break;
case CT_LABELSTRING:
lex.next();
labelstring_ = lex.getDocString();
}
+docstring Counters::prettyCounter(docstring const & name,
+ string const & lang) const
+{
+ CounterList::const_iterator it = counterList_.find(name);
+ if (it == counterList_.end())
+ return from_ascii("??");
+ Counter const & ctr = it->second;
+
+ docstring const value = theCounter(name, lang);
+ docstring const & format = ctr.prettyFormat();
+ if (format.empty())
+ return value;
+ return subst(format, from_ascii("##"), value);
+}
+
+
docstring Counters::currentCounter() const
{
LASSERT(!counter_stack_.empty(), /* */);