I'm trying to make a song library/search sort of program. The program needs to have an entry/ID number for each song (Going up by one for each new song added to the library) I have a text file with a listing of songs like the following:
My question(s) however, is how do I get it to add each song from the text file to it's own MusicEntry? How does it know that one of the songs in the file is "over", can you set the program to detect a blank line?
Would you also recommend that I use 2 maps for this project? One map storing the Entry # and the MusicEntry and another map inside each MusicEntry that contains (Name, Jonthan Coutlon), etc for all the components of each song?
Well, you could use a delimiter between each entry to note where the song information ends between two. Not sure whether a blank line would be ideal... You could see whether there is some other character to be put into it.
And how would you "place" the information from each line to the correct spot in a new MusicEntry? Would you need to split a line into words and add them into a vector and then do first,second,third that correspond to the element of the song (Title, Artist, etc.)? But in that case, what if the Artist is missing/not given in the file?
Something tells me I might also be over thinking this., I tend to do that a lot :\