Locate multiple class pointers at a string
<p>Ok this is extremely hard to explain. I tried to write a 100 line explanation in here, after I saw I failed I tried to create an image to better explain it which also failed <a href="http://img208.imageshack.us/img208/7383/48821020.png" rel="nofollow">http://img208.imageshack.us/img208/7383/48821020.png</a></p>

<p>It seems impossible because the complexity it extremely high. In the most raw is, I need to assign Id's for each part of a string. Currently I can assign Id's for a string example:</p>

<pre><code>He: hey
She: Hi
He: What's up
She: Not much, you?
He: I'm fine, i'm selling a &lt;Scale Armor&gt; wanna buy it?
She: Next time maybe.
</code></pre>

<p>I can return <code>What's up</code> by using the function <code>CString szText = GetTextAtLine(3);</code> because <code>What's up</code> is located on the third line of the chat. Each line has an Id, the Id is the line number. Each line also has a pointer to a class named <code>CItemElem</code>. CItemElem holds all the information about an item.</p>

<p>I Locate the pointer by using the following function <code>CItemElem *pItem = GetItemAtLineId(5)</code>, it would return the a pointer stored at <code>map&lt;unsigned int,CItemElem*&gt;mItemChat</code> where <code>unsigned int</code> is the line indetifier. Everytime someone talks something in chat if an item has been input at the chat a new element is inserted into the STL map with it's line id. </p>

<pre><code>CItemElem* CEditString::GetItemAtLineId( unsigned long uLine )
{

    for( map&lt;unsigned int,CItemElem*&gt;::iterator it = m_mItemChat.begin(); it != m_mItemChat.end(); ++it )
    {
        if( uLine == it-&gt;first )
            return( it-&gt;second );
    }

    return NULL;
}
</code></pre>

<p>So as you can see I can locate a <code>CItemElem</code> pointer by the line Id, but now my problem is I need to locate multiple items at the string because a max of 3 items can be input in a sentence at time:</p>

<pre><code>He: Hey guys i'm selling &lt;Scale Boots&gt; &lt;Wooden Sword&gt; &lt;Water Helmet&gt; cool items!
</code></pre>

<p>Currently I can return only 1 item at a chat sentence at a time because I can locate the item by the line Id. I've been toasting my brain the past hours, please enlighten me how to be able to return more than one item at the same sentence Id.</p>

<p>Thanks a lot!</p>
