MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / ListFile_GetNextLine

Function ListFile_GetNextLine

src/External/CascLib/src/common/ListFile.cpp:188–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188size_t ListFile_GetNextLine(void * pvListFile, const char ** pszLineBegin, const char ** pszLineEnd)
189{
190 PLISTFILE_CACHE pCache = (PLISTFILE_CACHE)pvListFile;
191 char * szExtraString = NULL;
192 char * szLineBegin;
193 char * szLineEnd;
194
195 // Skip newlines, spaces, tabs and another non-printable stuff
196 // Remember the begin of the line
197 szLineBegin = ListFile_SkipSpaces(pCache);
198
199 // Copy the remaining characters
200 while(pCache->pPos < pCache->pEnd)
201 {
202 // If we have found a newline, stop loading
203 // Note: the 0x85 char came from Overwatch build 24919
204 if(pCache->pPos[0] == '\x0A' || pCache->pPos[0] == '\x0D' || pCache->pPos[0] == '\x85')
205 break;
206
207 // Blizzard listfiles can also contain information about patch:
208 // Pass1\Files\MacOS\unconditional\user\Background Downloader.app\Contents\Info.plist~Patch(Data#frFR#base-frFR,1326)
209 if(pCache->pPos[0] == '~')
210 szExtraString = pCache->pPos;
211
212 // Move the position by one character forward
213 pCache->pPos++;
214 }
215
216 // Remember the end of the line
217 szLineEnd = (szExtraString != NULL && szExtraString[0] == '~' && szExtraString[1] == 'P') ? szExtraString : pCache->pPos;
218
219 // Give the caller the positions of the begin and end of the line
220 pszLineBegin[0] = szLineBegin;
221 pszLineEnd[0] = szLineEnd;
222 return (size_t)(szLineEnd - szLineBegin);
223}
224
225size_t ListFile_GetNextLine(void * pvListFile, char * szBuffer, size_t nMaxChars)
226{

Callers 4

ParseFile_CdnConfigFunction · 0.85
ParseFile_CdnBuildFunction · 0.85
SearchMethod · 0.85
ListFile_GetNextFunction · 0.85

Calls 2

ListFile_SkipSpacesFunction · 0.85
SetCascErrorFunction · 0.85

Tested by

no test coverage detected