/*------------------------------------------------------------------------------
 src/lib/dj/djDbg_.h
 
 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.
------------------------------------------------------------------------------*/

#include <djSerialize.h>

namespace dj {

template <class T>
inline Dbg & operator << (Dbg & dbg, const T & in)
{
  return dbg << deflateStr(in);
}

template <class Key, class Value>
inline Dbg & operator << (Dbg & dbg, const Map<Key, Value> & in)
{
  const List<Key> keyList = in.keyList();
  for (int i = 0; i < keyList.size(); ++i) {
    dbg << Str("\"%1\"=\"%2\"").arg(keyList[i]).arg(in[keyList[i]]);
    if (i < keyList.size() - 1) dbg << " ";
  }
  return dbg;
}

}
