-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cpp
41 lines (32 loc) · 1023 Bytes
/
Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//#define _CRTDBG_MAP_ALLOC
//#include <stdlib.h>
//#include <crtdbg.h>
#include <iostream>
#include <cstring> //c string
#include <cctype> //tolower
#include "UserInterface.h"
#include "InputTools.h"
#include "Song.h"
#include "SongList.h"
using namespace std;
//TODO: clean up unused imports, separate headers and implementations more cleanly
// note for compilation/memleak check
// valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all -v /Users/wolfmac/clionprojects/musiclibrary/app
//g++ -Wall *.cpp -o app
int main() {
//enable memory leak detection tools
//_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
char command;
char fileName[] = "/Users/wolfmac/CLionProjects/MusicLibrary/songs.txt";
SongList list(fileName);
Song aSong;
displayMenu();
command = readInCommand();
while (command != '6') {
processCommand(command, list);
displayMenu();
command = readInCommand();
}
list.saveSongs(fileName);
return 0;
}