1   /************************************************************************
  2           Copy Handler 1.x - program for copying data in Microsoft Windows
  3                                                    systems.
  4           Copyright (C) 2001-2004 Ixen Gerthannes (copyhandler@o2.pl)
  5  
  6           This program is free software; you can redistribute it and/or modify
  7           it under the terms of the GNU General Public License as published by
  8           the Free Software Foundation; either version 2 of the License, or
  9           (at your option) any later version.
  10  
  11           This program is distributed in the hope that it will be useful,
  12           but WITHOUT ANY WARRANTY; without even the implied warranty of
  13           MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14           GNU General Public License for more details.
  15  
  16           You should have received a copy of the GNU General Public License
  17           along with this program; if not, write to the Free Software
  18           Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19   *************************************************************************/
  20   #include "stdafx.h"
  21   #include "shortcuts.h"
  22  
  23   bool CShortcut::FromString(const CString& strText)
  24   {
  25           int iPos=strText.ReverseFind(_T('|'));
  26           if (iPos != -1 && iPos < strText.GetLength()-1)
  27           {
  28                   m_strName=strText.Left(iPos);
  29                   m_strPath=strText.Mid(iPos+1);
  30  
  31                   return true;
  32           }
  33           else
  34                   return false;
  35   }
  36  
  37   CShortcut::CShortcut(const CString& strText)
  38   {
  39           FromString(strText);
  40   }
  41  
  42   CShortcut::operator CString()
  43   {
  44           if (m_strPath.IsEmpty())
  45                   return _T("");
  46           else
  47                   return m_strName+_T("|")+m_strPath;
  48   }