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

Method Seek

src/SafeFile.cpp:100–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99
100uint64 CFileDataIO::Seek(sint64 offset, wxSeekMode from) const
101{
102 sint64 newpos = 0;
103 switch (from) {
104 case wxFromStart:
105 newpos = offset;
106 break;
107
108 case wxFromCurrent:
109 newpos = GetPosition() + offset;
110 break;
111
112 case wxFromEnd:
113 newpos = GetLength() + offset;
114 break;
115
116 default:
117 MULE_VALIDATE_PARAMS(false, "Invalid seek-mode specified.");
118 }
119
120 MULE_VALIDATE_PARAMS(newpos >= 0, "Position after seeking would be less than zero!");
121
122 sint64 result = doSeek(newpos);
123 MULE_VALIDATE_STATE(result >= 0, "Seeking resulted in invalid offset.");
124 MULE_VALIDATE_STATE(result == newpos, "Target position and actual position disagree.");
125
126 return result;
127}
128
129
130uint8 CFileDataIO::ReadUInt8() const

Callers 15

SetHashMethod · 0.80
SaveHashSetMethod · 0.80
LoadHashSetMethod · 0.80
DbgTestMethod · 0.80
SaveMethod · 0.80
CreateSrcInfoPacketMethod · 0.80
CTagMethod · 0.80
SendListToServerMethod · 0.80
KademliaSearchKeywordMethod · 0.80
ProcessLocalRequestsMethod · 0.80
OnHostnameResolvedMethod · 0.80

Calls

no outgoing calls

Tested by 11

writePredefDataFunction · 0.64
runMethod · 0.64
runMethod · 0.64
runMethod · 0.64
runMethod · 0.64
runMethod · 0.64
runMethod · 0.64
TESTFunction · 0.64
toStringFunction · 0.64
check_single_kad_tagFunction · 0.64