Changeset 986 for trunk


Ignore:
Timestamp:
Dec 13, 2009, 9:41:15 PM (13 years ago)
Author:
Peter Johansson
Message:

refs #405. added suopport to set image format in config file.

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Configuration.cc

    r978 r986  
    122122    return str=="true" || str=="True" || str=="TRUE" ||
    123123      str=="yes" || str=="Yes" || str=="YES";
     124  }
     125
     126
     127  const std::string& Configuration::image_format(void) const
     128  {
     129    return image_format_;
    124130  }
    125131
     
    282288        }
    283289      }
     290      else if (section == "image") {
     291        if (lhs == "format") {
     292          if (rhs!="none" && rhs!="png" && rhs!="svg") {
     293            throw Config_error(line, "unknown format: " + rhs);
     294          }
     295          image_format_ = rhs;
     296        }
     297      }
    284298    }
    285299    validate_dictionary();
     
    422436
    423437    dictionary_ = VectorPair(1, std::make_pair("*.in", "$1"));
     438    image_format_ = "png";
    424439  }
    425440
     
    480495      os << i->first << " = " << i->second.name() << "\n";
    481496    }
     497
     498    os << "\n"
     499       << "### Section for images\n"
     500       << "[image]\n"
     501       << "format = " << conf.image_format() << "\n";
     502
    482503
    483504    os << "\n"
  • trunk/lib/Configuration.h

    r978 r986  
    7070    ///
    7171    const std::map<std::string, Alias>& copyright_alias(void) const;
     72
     73    /**
     74       \return png, none, svg, or svgz
     75     */
     76    const std::string& image_format(void) const;
    7277
    7378    ///
     
    143148
    144149    VectorPair dictionary_;
    145 
     150    std::string image_format_;
    146151    std::string trac_root_;
    147152  };
Note: See TracChangeset for help on using the changeset viewer.