47#include <boost/smart_ptr/scoped_ptr.hpp> 
   61#define ELEMENT_ALIGN_LEFT 0x01 
   63    enum kind_t { STRING, EXPR };
 
   66    std::size_t                  min_width;
 
   67    std::size_t                  max_width;
 
   68    variant<string, expr_t>      data;
 
   69    scoped_ptr<struct element_t> next;
 
   75    ~element_t() throw() {
 
   79    element_t& operator=(
const element_t& elem) {
 
   83        min_width = elem.min_width;
 
   84        max_width = elem.max_width;
 
   90    friend inline void mark_red(std::ostream& out, 
const element_t * elem) {
 
   91      out.setf(std::ios::left);
 
  100      if (elem->min_width > 0)
 
  101        out.width(
static_cast<std::streamsize
>(elem->min_width));
 
  104    void dump(std::ostream& out) 
const;
 
  107  scoped_ptr<element_t> elements;
 
  120  static element_t * parse_elements(
const string& fmt,
 
  121                                    const optional<format_t&>& tmpl);
 
  138                    const optional<format_t&>& tmpl = none) {
 
  139    elements.reset(parse_elements(_format, tmpl));
 
 
  144    for (element_t * elem = elements.get(); elem; elem = elem->next.get()) {
 
  145      if (elem->type == element_t::EXPR) {
 
  146        expr_t& expr(boost::get<expr_t>(elem->data));
 
 
  154  virtual void dump(std::ostream& out)
 const {
 
  155    for (
const element_t * elem = elements.get();
 
  157         elem = elem->next.get())
 
 
  162                         const std::size_t width,
 
  163                         const std::size_t account_abbrev_length = 0);
 
 
#define TRACE_CTOR(cls, args)
#define DECLARE_EXCEPTION(name, kind)
#define ELEMENT_ALIGN_LEFT
virtual void mark_uncompiled()
expr_base_t(const expr_base_t &other)
void set_text(const string &txt)
format_error(const string &why)
static enum ledger::format_t::elision_style_t default_style
virtual void dump(std::ostream &out) const
format_t(const string &_str, scope_t *context=NULL)
virtual void mark_uncompiled()
static string truncate(const unistring &str, const std::size_t width, const std::size_t account_abbrev_length=0)
void parse_format(const string &_format, const optional< format_t & > &tmpl=none)
virtual result_type real_calc(scope_t &scope)
static bool default_style_changed
Abstract working with UTF-32 encoded Unicode strings.