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

template<typename T, template< typename T > class C>
void sbuild::keyfile::set_list_value ( std::string const &  group,
std::string const &  key,
C< T > const &  value,
std::string const &  comment 
) [inline]

Set a key value from a list.

Parameters:
group the group the key is in.
key the key to set.
value the list value to get the key's value from. The value type must allow output to an ostream. The list must be a container with a standard forward iterator.
comment the comment for this key.

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

References separator, and set_value().

    {
      std::string strval;

      for (typename C<T>::const_iterator pos = value.begin();
         pos != value.end();
         ++ pos)
      {
        std::ostringstream os;
        os.imbue(std::locale("C"));
        os << std::boolalpha << *pos;
        if (os)
          {
            strval += os.str();
            if (pos + 1 != value.end())
            strval += this->separator;
          }
      }

      set_value (group, key, strval, comment);
    }


Generated by  Doxygen 1.6.0   Back to index