This repository was archived by the owner on Nov 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlaylistTracker.hpp
More file actions
90 lines (77 loc) · 2.18 KB
/
PlaylistTracker.hpp
File metadata and controls
90 lines (77 loc) · 2.18 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef PLAYLIST_TRACKER_HPP_
#define PLAYLIST_TRACKER_HPP_
#include <string>
#include <vector>
namespace playlist_tracker {
namespace constants {
namespace terminal {
static auto const CLS = "CLS";
static auto const PAUSE = "PAUSE";
}
namespace options {
auto const CREATE_PLAYLIST = "c";
auto const DELETE_PLAYLIST = "d";
auto const ADD_TRACK = "a";
auto const EXIT = "x";
}
namespace separators {
static auto const SEPARATOR_1 = ": "; // title + artist -> artist + title
static auto const SEPARATOR_2 = " - "; // title + artist -> title + artist
static auto const SEPARATOR_3 = " by "; // title + artist -> artist + title
}
namespace labels {
static auto const TITLE_LABEL = "Title: ";
static auto const ARTIST = "Artist: ";
}
static auto const FILE_EXTENSION = ".playlist";
static auto const INTEGER_STR_VALUES = "0123456789";
static auto const MIN_INPUT_LENGHT = 5;
}
namespace base {
typedef struct {
std::string title;
std::string artist;
} track;
class playlist {
public:
playlist(std::string name);
virtual ~playlist(void);
auto get_name(void)->std::string;
auto add_track(track * & track, const bool silent)->void;
auto remove_track(int index)->void;
auto display_tracks(void)->std::string;
auto get_tracks(void)->std::vector<track>;
private:
std::string name;
std::vector<track> tracks;
};
static std::vector<playlist *> * PLAYLISTS;
namespace index {
auto display_main_menu(void)->void;
auto display_playlist_menu(std::string & input)->bool;
auto display_create_playlist_menu(void)->void;
auto display_track_menu(int & index)->void;
auto display_create_track_menu(playlist * & playlist)->void;
}
namespace utils {
typedef struct {
std::size_t from;
std::size_t to;
} input_args_info;
class tracker_parsing {
public:
static auto make_tracker(std::string & input)->track *;
private:
static auto trim_by_pattern(
const char * & pattern, std::string & input,
track * & track)->void;
};
namespace io {
auto read_contents()->void;
auto write_contents()->void;
}
auto is_number(std::string & str_num)->bool;
}
}
}
#endif