本文整理汇总了C++中Disk::backup方法的典型用法代码示例。如果您正苦于以下问题:C++ Disk::backup方法的具体用法?C++ Disk::backup怎么用?C++ Disk::backup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Disk
的用法示例。
在下文中一共展示了Disk::backup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: diskTest
string diskTest()
{
Disk * disk = new Disk(1000000000, "test", false);
if(disk->isReadOnly()) return "readonly check failed";
if(disk->getCapacity() != 1000000000) return "capacity check failed";
if(!disk->getRootFolder()) return "root folder was not generated";
if(disk->getRootFolder()->getName() != "test") return "root folder name check failed";
File * infected = new File();
Virus * virus = new Virus();
infected->setVirus(virus);
disk->getRootFolder()->addFile(infected);
Disk * backup = new Disk(1000000000, "b", true);
if(!disk->backup(backup)) return "backup failed";
vector<pair<Folder *, int>> folds;
backup->getRootFolder()->getAllFoldersRecursively(folds);
if(!folds.size()) return "backup was not created";
delete disk;
delete backup;
return "";
}