PrettyPrint.h

// PrettyPrint.h
//
// Author Jesse Pepper
// (C)opyright Cedanet Pty Ltd 2012

@import "xmap.h"
@import "Ceda/cxObject/ListToOStream2.h"
@import "Ceda/cxObject/PrintReflectedType.h"

namespace ceda
{
   
template <typename K, typename V> 
xostream& operator<<(xostream& os, const xmap<K,V>& v)
{
    //mAsSquareBracketed(mAsIndented(mAsLineFeedSeparatedList(v)));
    os << "{\n";
    {
        Indenter indenter(os,4);
        for (typename xmap<K,V>::const_iterator p = v.begin() ; p != v.end() ; ++p)
        {
            os << "    " << p->first << " -> " << p->second << "\n";
        }
    }
    os << "}\n";
    return os;
}

template <typename K> 
xostream& operator<<(xostream& os, const xset<K>& v)
{
    os << "{\n";
    {
        Indenter indenter(os,4);
        for (typename xset<K>::const_iterator p = v.begin() ; p != v.end() ; ++p)
        {
            os << "    " << *p << "\n";
        }
    }
    os << "}\n";
    return os;
}

} // ceda