Skip to content

Commit

Permalink
Error msg add if the dat file is empty
Browse files Browse the repository at this point in the history
used if else
  • Loading branch information
Abir-Tx committed Oct 22, 2020
1 parent 1e7250c commit 58ac8f9
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions include/dirTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,27 @@ void dirTree()

ifstream driveLetterReader("C:\\SFO\\Data\\DriveLetterKeeper.dat");

while(getline(driveLetterReader, driveLetterHolder))
while (getline(driveLetterReader, driveLetterHolder))
{
driveLetterHolder = driveLetterHolder;
}
if (driveLetterHolder.empty() == true)
{
system("cls");
cout << "You have not created ant folders yet. Please go to the create mode to create folders first!3" << endl;
}
else
{
//Starting the dir tree
system("cls");
system("color 03");
cout << setw(75) << setfill(' ') << "Directory Tree Viewer" << endl
<< endl;

//Starting the dir tree
system("cls");
system("color 03");
cout<<setw(75)<<setfill(' ')<<"Directory Tree Viewer"<<endl<<endl;

cout<<"Printing the folders structure view inside the selected drive: "<<endl;
std::cout<<std::endl;
string treeDir = "tree /f "+driveLetterHolder+":\\\"University Study\"";
system(treeDir.c_str());
cout << "Printing the folders structure view inside the selected drive: " << endl;
std::cout << std::endl;
string treeDir = "tree /f " + driveLetterHolder + ":\\\"University Study\"";
system(treeDir.c_str());
}
}
#endif // DIRTREE_H

0 comments on commit 58ac8f9

Please sign in to comment.