All right. I'm not very good with pseudo code, but there's no need to cloak and dagger this stuff.
In the header, as part of my MFC app's document class:
typedef pair <const CString, CString> cCStr2CStr;
map <CString, CString> MACaddrMAP;
map <CString, CString>:: key_type key1;
map <CString, CString>::_Tref mapped1;
//map <CString, CString>:: value_type value1;
map <CString, CString>:: iterator mapIter;
I'm not entirely sure I'll even need all of the above.
In the constructor for the document class:
CGUISnoopDoc::CGUISnoopDoc():mapped1(MACaddrMAP.begin()->second)
{
MACaddrMAP.insert (cCStr2CStr("FF:FF:FF:FF:FF","Ethernet Broadcast") );
}
and I get this error from putting this stuff in:
c:\program files\microsoft visual studio\vc98\include\xtree(151) : warning C4786: '?$reverse_bidirectional_iterator@Viterator@?$_Tree@VCString@@U?$pair@$$
CBVCString@@V1@@std@@U_Kfn@?$map@VCString@@V1@U?$less
@VCString@@@std@@V?$allocator@VCString@@@3
@@3@U?$less@VCString@@@3@V?$allocator@VCString@@@3@@
std@@U?$pair@$$CBVCString@@V1@@3@AAU43@PAU43@H' :
identifier was truncated to '255' characters in the browser information
c:\program files\microsoft visual studio\vc98\include\map(46) :
see reference to class template instantiation
'std::_Tree<class CString,struct std::pair<class CString const ,class CString>,
struct std::map<class CString,class CString,struct std::less<class CString>,
class std::allocator<class CString> >::_Kfn,struct std::less<class CString>,
class std::allocator<class CString> >' being compiled
c:\mfctutorials\guisnoop\guisnoopdoc.h(72) : see reference to class template instantiation
'std::map<class CString,class CString,struct std::less<class CString>,class std::allocator<class CString> >' being compiled
I just want a map class that pairs off a CString as both key and value. This map will be initially populated by the program, setting the key and value to the same CString.
The user will then be able to edit the value and have the program remap all occurances of that value to the new definition, while preserving the original CString in the key.
This is going to be used to make a whole bunch of MAC addresses more distinct when viewed in a column, and I figure that this is the best way to do it so that the program can be expanded to save the user-defined values for reload later.
I never really did pseudocode, I'm afraid, If this isn't good enough, I'll go learn a pseudocode method as fast as I can...