My Project
Functions
movie.cpp File Reference
#include "movie.h"

Functions

string getMovieByPosition (int position, filemanip &file)
 Finds a movie in position position of a file and returns the name of the movie. More...
 
string getMovieByName (string moviename, filemanip &file)
 Finds the information of a movie given its name. More...
 
void showMovie (string movieinfo)
 Display the movie information of a | separated line with movie info. Example line: Ninja Turtles: The Next Mutation, Vol. 1|Shout! Factory||Out|2.0|4:3|19.93|NR|1997|. More...
 
void showMovies (filemanip &file, int start, int end)
 Display the information of the movies in a file from line start to line end. More...
 
void showMovies (filemanip &file, string keyword)
 Display the information of the movies whose name contains a given keyword. More...
 
string getMovieName (string movieinfo)
 Given a movie line from the file returns the movie name. More...
 
string getMovieRating (string movieinfo)
 Given a movie line from the file returns the movie rating. More...
 
string getMovieYear (string movieinfo)
 Given a movie line from the file returns the movie release year. More...
 
string getMovieGenre (string movieinfo)
 Given a movie line from the file returns the movie genre. More...
 
void getMovieInfo (string movieinfo, string &name, string &rating, string &year, string &genre)
 Given a movie line from the file returns by reference the movie name, rating, year, and genre. More...
 
string getMovieStudio (string movieinfo)
 Given a movie line from the file returns the movie studio. Answer to (Exercise 3, question 1) More...
 
void getMovieInfo (string movieinfo, string &name, string &rating, string &year, string &genre, string &studio)
 Given a movie line from the file returns by reference the movie name, rating, year, genre, and studio. Answer to (Exercise 3, question 2) More...
 
void showMovieInLine (string movieinfo)
 Display the movie information of a | separated line with movie info. The info is displayed in one line identified by its fields. Answer to (Exercise 3, question 3) More...
 
void showMoviesInLine (filemanip &file, int start, int end)
 Display the information of the movies in a file from line start to line end. The information is displayed in one line. Answer to (Exercise 3, question 4) More...
 

Function Documentation

string getMovieByName ( string  moviename,
filemanip file 
)

Finds the information of a movie given its name.

Parameters
movienameThe name of the movie
fileA file pointer
Returns
One line with the information of the movie separated by | (pipes)
string getMovieByPosition ( int  position,
filemanip file 
)

Finds a movie in position position of a file and returns the name of the movie.

Parameters
positionPosition of the movie in the file
fileA file pointer
Returns
The name of the movie
string getMovieGenre ( string  movieinfo)

Given a movie line from the file returns the movie genre.

Parameters
movieinfoThe information of the movie in one line separated by |
Returns
The movie genre.
void getMovieInfo ( string  movieinfo,
string &  name,
string &  rating,
string &  year,
string &  genre 
)

Given a movie line from the file returns by reference the movie name, rating, year, and genre.

Parameters
movieinfoThe information of the movie in one line separated by |
void getMovieInfo ( string  movieinfo,
string &  name,
string &  rating,
string &  year,
string &  genre,
string &  studio 
)

Given a movie line from the file returns by reference the movie name, rating, year, genre, and studio. Answer to (Exercise 3, question 2)

Parameters
movieinfoThe information of the movie in one line separated by |
string getMovieName ( string  movieinfo)

Given a movie line from the file returns the movie name.

Parameters
movieinfoThe information of the movie in one line separated by |
Returns
Movie name
string getMovieRating ( string  movieinfo)

Given a movie line from the file returns the movie rating.

Parameters
movieinfoThe information of the movie in one line separated by |
Returns
The movie rating
string getMovieStudio ( string  movieinfo)

Given a movie line from the file returns the movie studio. Answer to (Exercise 3, question 1)

Parameters
movieinfoThe information of the movie in one line separated by |
Returns
The movie studio.
string getMovieYear ( string  movieinfo)

Given a movie line from the file returns the movie release year.

Parameters
movieinfoThe information of the movie in one line separated by |
Returns
The movie release year.
void showMovie ( string  movieinfo)

Display the movie information of a | separated line with movie info. Example line: Ninja Turtles: The Next Mutation, Vol. 1|Shout! Factory||Out|2.0|4:3|19.93|NR|1997|.

Parameters
movieinfoThe information of the movie in one line separated by |
void showMovieInLine ( string  movieinfo)

Display the movie information of a | separated line with movie info. The info is displayed in one line identified by its fields. Answer to (Exercise 3, question 3)

Parameters
movieinfoThe information of the movie in one line separated by |
void showMovies ( filemanip file,
int  start,
int  end 
)

Display the information of the movies in a file from line start to line end.

Parameters
filePointer to a file.
startLine in the file to start showing movie info.
endLine in the file to stop showing movie information.
void showMovies ( filemanip file,
string  keyword 
)

Display the information of the movies whose name contains a given keyword.

Parameters
filePointer to a file.
keywordKeyword to search in the name of the movies.
void showMoviesInLine ( filemanip file,
int  start,
int  end 
)

Display the information of the movies in a file from line start to line end. The information is displayed in one line. Answer to (Exercise 3, question 4)

Parameters
filePointer to a file.
startLine in the file to start showing movie info.
endLine in the file to stop showing movie information.