Logo Search packages:      
Sourcecode: schroot version File versions  Download package

template<class charT, class traits>
std::basic_ostream<charT,traits>& operator<< ( std::basic_ostream< charT, traits > &  stream,
keyfile const &  kf 
) [friend]

keyfile output to an ostream.

Definition at line 595 of file sbuild-keyfile.h.

    {
      unsigned int group_count = 0;

      for (group_map_type::const_iterator gp = kf.groups.begin();
         gp != kf.groups.end();
         ++gp, ++group_count)
      {
        if (group_count > 0)
          stream << '\n';

        group_type const& group = gp->second;
        std::string const& groupname = std::tr1::get<0>(group);
        std::string const& comment = std::tr1::get<2>(group);

        if (comment.length() > 0)
          print_comment(comment, stream);

        stream << '[' << groupname << ']' << '\n';

        item_map_type const& items(std::tr1::get<1>(group));
        for (item_map_type::const_iterator it = items.begin();
             it != items.end();
             ++it)
          {
            item_type const& item = it->second;
            std::string const& key(std::tr1::get<0>(item));
            std::string const& value(std::tr1::get<1>(item));
            std::string const& comment(std::tr1::get<2>(item));

            if (comment.length() > 0)
            print_comment(comment, stream);

            stream << key << '=' << value << '\n';
          }
      }

      return stream;
    }


Generated by  Doxygen 1.6.0   Back to index