예제 #1
0
        private HZincWriter writeDictKeyVals(HDict dict)
        {
            if (dict.isEmpty())
            {
                return(this);
            }
            bool bFirst = true;

            for (int i = 0; i < dict.size(); i++)
            {
                string name = dict.getKeyAt(i, false);
                if (name != null)
                {
                    HVal val = (HVal)dict.get(name, false);
                    if (!bFirst)
                    {
                        p(' ');
                    }
                    p(name);
                    if (val != HMarker.VAL)
                    {
                        p(':').writeVal(val);
                    }
                    bFirst = false;
                }
            }
            flush();
            return(this);
        }
예제 #2
0
        private void writeDictTags(HDict dict, bool first)
        {
            bool bLocalFirst = first;

            // Is ther a multi-threaded issue here - for a changing size of dict
            for (int i = 0; i < dict.size(); i++)
            {
                if (bLocalFirst)
                {
                    bLocalFirst = false;
                }
                else
                {
                    m_swOut.Write(", ");
                }
                string name = dict.getKeyAt(i, true);
                HVal   val  = dict.get(name, false);
                m_swOut.Write(HStr.toCode(name));
                m_swOut.Write(":");
                writeVal(val);
            }
        }