2 * Copyright (C) 2005-2013 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
21 #include "PlayListURL.h"
22 #include "filesystem/File.h"
23 #include "utils/URIUtils.h"
24 #include "utils/StringUtils.h"
26 using namespace PLAYLIST;
27 using namespace XFILE;
31 //BASEURL=http://msdn2.microsoft.com/en-us/library/ms812698.aspx
33 //URL=http://msdn2.microsoft.com/en-us/library/ms812698.aspx
35 CPlayListURL::CPlayListURL(void)
38 CPlayListURL::~CPlayListURL(void)
41 bool CPlayListURL::Load(const CStdString& strFileName)
48 m_strPlayListName = URIUtils::GetFileName(strFileName);
49 URIUtils::GetParentPath(strFileName, m_strBasePath);
52 if (!file.Open(strFileName) )
58 while (file.ReadString(szLine, 1024))
61 StringUtils::RemoveCRLF(strLine);
63 if (StringUtils::StartsWith(strLine, "[InternetShortcut]"))
65 if (file.ReadString(szLine,1024))
68 StringUtils::RemoveCRLF(strLine);
69 if (StringUtils::StartsWith(strLine, "URL="))
71 CFileItemPtr newItem(new CFileItem(strLine.substr(4), false));