Exemple #1
0
        public int Next(int count, ulong[] refs, out int pWrote)
        {
            if (m_obj == 0 && !m_done)
            {
                m_done = true;
                pWrote = 0;
                return(HRESULTS.S_FALSE);
            }

            if (m_done)
            {
                pWrote = 0;
                return(HRESULTS.E_FAIL);
            }

            int wrote = 0;

            while (wrote < count && m_obj != 0)
            {
                refs[wrote++] = m_obj;
                m_obj         = m_seg.NextObject(m_obj);
            }

            pWrote = wrote;
            if (wrote < count || m_obj == 0)
            {
                m_done = true;
                return(HRESULTS.S_FALSE);
            }

            return(HRESULTS.S_OK);
        }
Exemple #2
0
        public void EnumerateObjects(out IMDObjectEnum ppEnum)
        {
            List <ulong> refs = new List <ulong>();

            for (ulong obj = m_seg.FirstObject; obj != 0; obj = m_seg.NextObject(obj))
            {
                refs.Add(obj);
            }

            ppEnum = new MDObjectEnum(refs);
        }
Exemple #3
0
 /// <summary>
 ///     Given an object on the segment, return the 'next' object in the segment.  Returns
 ///     0 when there are no more objects.   (Or enumeration is not possible)
 /// </summary>
 /// <param name="objRef">The object reference.</param>
 /// <returns>System.UInt64.</returns>
 /// <inheritdoc />
 public ulong NextObject(ulong objRef) => Segment.NextObject(objRef);