Changeset 996
- Timestamp:
- Dec 28, 2009, 4:57:06 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Configuration.cc
r995 r996 122 122 return str=="true" || str=="True" || str=="TRUE" || 123 123 str=="yes" || str=="Yes" || str=="YES"; 124 } 125 126 127 const std::string& Configuration::image_anchor_format(void) const 128 { 129 return image_anchor_format_; 124 130 } 125 131 … … 294 300 } 295 301 image_format_ = rhs; 302 } 303 else if (lhs == "image_format") { 304 if (rhs!="none" && rhs!="png" && rhs!="svg" && rhs!="pdf") { 305 throw Config_error(line, "unknown format: " + rhs); 306 } 307 image_anchor_format_ = rhs; 296 308 } 297 309 } … … 438 450 dictionary_ = VectorPair(1, std::make_pair("*.in", "$1")); 439 451 image_format_ = "png"; 452 image_anchor_format_ = "png"; 440 453 } 441 454 … … 501 514 << "[image]\n" 502 515 << "format = " << conf.image_format() << "\n"; 516 os << "anchor_format = " << conf.image_anchor_format() << "\n"; 503 517 504 518 -
trunk/lib/Configuration.h
r986 r996 70 70 /// 71 71 const std::map<std::string, Alias>& copyright_alias(void) const; 72 73 /** 74 \return pdf, png, none, or svg 75 */ 76 const std::string& image_anchor_format(void) const; 72 77 73 78 /** … … 148 153 149 154 VectorPair dictionary_; 155 std::string image_anchor_format_; 150 156 std::string image_format_; 151 157 std::string trac_root_; -
trunk/test/config_test.cc
r978 r996 28 28 namespace svndigest{ 29 29 void test_codon(test::Suite&); 30 void test_read_write(test::Suite&); 30 31 }} // end of namespace svndigest and theplu 31 32 … … 37 38 38 39 test_codon(suite); 40 test_read_write(suite); 39 41 40 42 if (suite.ok()) { … … 67 69 } 68 70 71 void test_read_write(test::Suite& suite) 72 { 73 Configuration& config = Configuration::instance(); 74 std::stringstream ss; 75 ss << config; 76 config.load(ss); 77 std::stringstream ss2; 78 ss2 << config; 79 if (ss2.str() != ss.str()) { 80 suite.out() << "error: configuration output not equal\n"; 81 suite.out() << "defalt output:\n" << ss.str() << "\n"; 82 suite.out() << "second output:\n" << ss2.str() << "\n"; 83 suite.add(false); 84 } 85 } 86 69 87 }} // end of namespace svndigest and theplu
Note: See TracChangeset
for help on using the changeset viewer.