2 * Copyright (c) 2002 Frodo
3 * Portions Copyright (c) by the authors of ffmpeg and xvid
4 * Copyright (C) 2002-2018 Team Kodi
5 * This file is part of Kodi - https://kodi.tv
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 * See LICENSES/README.md for more information.
18 using namespace XFILE
;
20 //////////////////////////////////////////////////////////////////////
21 // Construction/Destruction
22 //////////////////////////////////////////////////////////////////////
24 IFile::IFile() = default;
26 IFile::~IFile() = default;
28 int IFile::Stat(struct __stat64
* buffer
)
36 bool IFile::ReadString(char *szLine
, int iLineLength
)
38 if(Seek(0, SEEK_CUR
) < 0) return false;
40 int64_t iFilePos
= GetPosition();
41 int iBytesRead
= Read( (unsigned char*)szLine
, iLineLength
- 1);
45 szLine
[iBytesRead
] = 0;
47 for (int i
= 0; i
< iBytesRead
; i
++)
49 if ('\n' == szLine
[i
])
51 if ('\r' == szLine
[i
+ 1])
54 Seek(iFilePos
+ i
+ 2, SEEK_SET
);
60 Seek(iFilePos
+ i
+ 1, SEEK_SET
);
64 else if ('\r' == szLine
[i
])
66 if ('\n' == szLine
[i
+ 1])
69 Seek(iFilePos
+ i
+ 2, SEEK_SET
);
75 Seek(iFilePos
+ i
+ 1, SEEK_SET
);
83 CRedirectException::CRedirectException() :
84 m_pNewFileImp(NULL
), m_pNewUrl(NULL
)
88 CRedirectException::CRedirectException(IFile
*pNewFileImp
, CURL
*pNewUrl
) :
89 m_pNewFileImp(pNewFileImp
), m_pNewUrl(pNewUrl
)