Changeset 1152 for trunk/lib/Configuration.h
- Timestamp:
- Aug 7, 2010, 4:31:18 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Configuration.h
r1144 r1152 121 121 \return NULL if there is no prop for \a filename in config 122 122 */ 123 const std::map<std::string, std::string> *123 const std::map<std::string, std::string>& 124 124 svn_properties(const std::string& filename) const; 125 125 … … 152 152 bool equal_false(std::string) const; 153 153 bool equal_true(std::string) const; 154 155 /** 156 find first element in range, [first, last) for which 157 element->first matches filename. 158 159 Iterator->first must return string, i.e., [first, last) is 160 often a range of pair<string, T> 161 162 If no match is found, last is returned. 163 */ 164 template<typename Iterator> 165 Iterator find_fn(Iterator first, Iterator last, 166 const std::string& filename) const; 167 154 168 /// 155 169 /// @brief load deafult configuration … … 190 204 std::string trac_root_; 191 205 192 std::vector<std::map<std::string, std::string> > svn_props_; 206 typedef std::map<std::string, std::string> str_map; 207 typedef std::pair<std::string, str_map> props; 208 std::vector<props> svn_props_; 209 const str_map empty_str_map_; 193 210 }; 194 211 … … 226 243 }; 227 244 245 // template implementation 246 247 template<typename Iterator> 248 Iterator Configuration::find_fn(Iterator first, Iterator last, 249 const std::string& filename) const 250 { 251 for( ; first!=last; ++first) { 252 if (fnmatch(first->first.c_str(), filename.c_str())) 253 return first; 254 } 255 return last; 256 } 257 258 228 259 }} // end of namespace svndigest and namespace theplu 229 260
Note: See TracChangeset
for help on using the changeset viewer.