equal
deleted
inserted
replaced
696 |
696 |
697 CCmdRm::~CCmdRm() |
697 CCmdRm::~CCmdRm() |
698 { |
698 { |
699 delete iFileMan; |
699 delete iFileMan; |
700 iFileNames.Close(); |
700 iFileNames.Close(); |
|
701 iNonExpandedFilenames.ResetAndDestroy(); |
701 } |
702 } |
702 |
703 |
703 CCmdRm::CCmdRm() |
704 CCmdRm::CCmdRm() |
704 { |
705 { |
705 } |
706 } |
746 { |
747 { |
747 iForce = EFalse; // Otherwise we'll end up here again (could happen if iFileName is a directory and cannot be deleted because it contains read-only files |
748 iForce = EFalse; // Otherwise we'll end up here again (could happen if iFileName is a directory and cannot be deleted because it contains read-only files |
748 err = DoDelete(fileName); |
749 err = DoDelete(fileName); |
749 } |
750 } |
750 } |
751 } |
751 User::LeaveIfError(err); |
752 LeaveIfErr(err, _L("Couldn't delete '%S'"), &fileName); |
|
753 } |
|
754 |
|
755 for (TInt i = 0; i < iNonExpandedFilenames.Count(); i++) |
|
756 { |
|
757 TInt err = DoDelete(*iNonExpandedFilenames[i]); |
|
758 LeaveIfErr(err, _L("Couldn't delete '%S'"), iNonExpandedFilenames[i]); |
752 } |
759 } |
753 } |
760 } |
754 |
761 |
755 TInt CCmdRm::DoDelete(const TDesC& aFileName) |
762 TInt CCmdRm::DoDelete(const TDesC& aFileName) |
756 { |
763 { |
768 |
775 |
769 void CCmdRm::OptionsL(RCommandOptionList& aOptions) |
776 void CCmdRm::OptionsL(RCommandOptionList& aOptions) |
770 { |
777 { |
771 _LIT(KCmdRmOptRecurse, "recurse"); |
778 _LIT(KCmdRmOptRecurse, "recurse"); |
772 _LIT(KCmdRmOptForce, "force"); |
779 _LIT(KCmdRmOptForce, "force"); |
|
780 _LIT(KCmdRmOptNoexpand, "noexpand"); |
773 aOptions.AppendBoolL(iRecurse, KCmdRmOptRecurse); |
781 aOptions.AppendBoolL(iRecurse, KCmdRmOptRecurse); |
774 aOptions.AppendBoolL(iForce, KCmdRmOptForce); |
782 aOptions.AppendBoolL(iForce, KCmdRmOptForce); |
|
783 aOptions.AppendStringL(iNonExpandedFilenames, KCmdRmOptNoexpand); |
775 } |
784 } |
776 |
785 |
777 void CCmdRm::ArgumentsL(RCommandArgumentList& aArguments) |
786 void CCmdRm::ArgumentsL(RCommandArgumentList& aArguments) |
778 { |
787 { |
779 _LIT(KCmdRmArg, "file_name"); |
788 _LIT(KCmdRmArg, "file_name"); |