MCPcopy Create free account
hub / github.com/amule-project/amule / LoadFromFile

Method LoadFromFile

src/Friend.cpp:119–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118
119void CFriend::LoadFromFile(CFileDataIO* file)
120{
121 wxASSERT( file );
122
123 m_UserHash = file->ReadHash();
124 m_dwLastUsedIP = file->ReadUInt32();
125 m_nLastUsedPort = file->ReadUInt16();
126 m_dwLastSeen = file->ReadUInt32();
127 m_dwLastChatted = file->ReadUInt32();
128
129 uint32 tagcount = file->ReadUInt32();
130 for ( uint32 j = 0; j != tagcount; j++) {
131 CTag newtag(*file, true);
132 switch ( newtag.GetNameID() ) {
133 case FF_NAME:
134 if (m_strName.IsEmpty()) {
135 m_strName = newtag.GetStr();
136 }
137 break;
138 case FF_FRIENDSLOT:
139 m_HasFriendSlot = newtag.GetInt() != 0;
140 break;
141 }
142 }
143}
144
145
146void CFriend::WriteToFile(CFileDataIO* file)

Callers 3

LoadListMethod · 0.45
InitMethod · 0.45
AppendMethod · 0.45

Calls 6

ReadUInt32Method · 0.80
ReadUInt16Method · 0.80
GetNameIDMethod · 0.80
ReadHashMethod · 0.45
IsEmptyMethod · 0.45
GetIntMethod · 0.45

Tested by

no test coverage detected