/* Copyright © 2011-2013 Roger Leigh * * schroot is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * schroot is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see * . * *********************************************************************/ #include #include #include #include namespace sbuild { feature::feature(const std::string& feature, const std::string& description) { registered_features().insert(std::make_pair(feature, description)); } feature::~feature() { } std::ostream& feature::print_features(std::ostream& stream) { boost::format fmt(" %1$-12s %2%\n"); std::map& features = registered_features(); for (const auto& feature : features) stream << fmt % feature.first % gettext(feature.second); return stream; } std::map& feature::registered_features () { static std::map features; return features; } }