Changeset 975
- Timestamp:
- Oct 17, 2007, 11:03:37 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/commandline_test.cc
r965 r975 24 24 #include "yat/utility/CommandLine.h" 25 25 #include "yat/utility/OptionArg.h" 26 #include "yat/utility/OptionFile.h" 26 27 #include "yat/utility/OptionSwitch.h" 27 28 … … 61 62 } 62 63 64 CommandLine cmd; 65 OptionFile file(cmd, "f,file", "description"); 66 63 67 if (!ok) 64 68 *error << "commandline test failed" << std::endl; -
trunk/yat/utility/CommandLine.cc
r972 r975 135 135 } 136 136 } 137 for_each(options_.begin(),options_.end(),std::mem_fun(&Option::validate)); 137 for_each(options_.begin(),options_.end(), 138 std::mem_fun(&Option::validate)); 138 139 } 139 140 catch (std::runtime_error& e){ 140 141 std::stringstream ss; 141 ss << program_name_ << ": " << e.what() << "\n" << try_help();142 ss << program_name_ << ": " << e.what(); 142 143 throw std::runtime_error(ss.str()); 143 144 } -
trunk/yat/utility/Makefile.am
r965 r975 27 27 libutility_la_SOURCES = \ 28 28 Alignment.cc ColumnStream.cc CommandLine.cc FileUtil.cc kNNI.cc \ 29 matrix.cc NNI.cc Option.cc Option Switch.cc \29 matrix.cc NNI.cc Option.cc OptionFile.cc OptionSwitch.cc \ 30 30 PCA.cc stl_utility.cc SVD.cc TypeInfo.cc utility.cc vector.cc WeNNI.cc 31 31 … … 36 36 Exception.h FileUtil.h Iterator.h iterator_traits.h \ 37 37 IteratorWeighted.h kNNI.h matrix.h NNI.h \ 38 Option.h OptionArg.h Option Switch.h \38 Option.h OptionArg.h OptionFile.h OptionSwitch.h \ 39 39 PCA.h stl_utility.h SVD.h TypeInfo.h utility.h vector.h WeNNI.h \ 40 40 yat_assert.h -
trunk/yat/utility/Option.cc
r974 r975 39 39 { 40 40 if (flag.empty()) 41 throw std::runtime_error(" Option: given flag is empty");41 throw std::runtime_error("yat: Option: given flag is empty"); 42 42 if (flag.size()==1 || (flag.size()==2 && flag[1]==',')) 43 43 short_name_ = flag[0]; -
trunk/yat/utility/OptionArg.h
r965 r975 29 29 #include <stdexcept> 30 30 #include <string> 31 #include <sstream> 31 32 32 33 namespace theplu { … … 62 63 \return value 63 64 */ 64 T value(void) { return value_; }65 T value(void) const { return value_; } 65 66 66 67 private: … … 116 117 /** 117 118 */ 118 v oid do_validate(void) const {}119 virtual void do_validate(void) const {} 119 120 120 121 };
Note: See TracChangeset
for help on using the changeset viewer.