Пример #1
0
string album_db::showAlbumDetails(int album_id)
{
    std::stringstream out;

    int index = findAlbum(album_id);

    Album temp = albums.at(index);
    out << temp.albumDetails();

    return out.str();
}
Пример #2
0
bool album_db::saveToText(string file_name)
{
    ofstream textFile;
    textFile.open(file_name.data());

    if (textFile.is_open())
    {
        std::stringstream out;

        for(int i=0;i<albums.size();i++)
        {
            Album temp = albums.at(i);
            out <<temp.albumDetails();
        }
        textFile<<out.str();
    }
    else
    {
        return false;
    }

    textFile.close();
}