videoListType.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 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 91 92 93 94 95 96 97 98 99 100 101
|
#include <string>
#include <iomanip>
#include <iostream>
#include <fstream>
#include "videoType.h"
#include "unorderedLinkedList.h"
void videoListType::searchVideoList(string title, bool& found,
nodeType<videoType>* ¤t) const
{
found = false;
current = first;
while (current != NULL && !found)
if (current->info.checkTitle(title))
found = true;
else
current = current->link;
}
bool videoListType::isVideoAvailable(string title) const
{
bool found;
nodeType<videoType> *location;
searchVideoList(title, found, location);
if (found)
found = (location->info.getNoOfCopiesInStock() > 0);
else
found = false;
return found;
}
void videoListType::videoCheckIn(string title)
{
bool found = false;
nodeType<videoType> *location;
searchVideolist(title, found, location);
if (found)
location->info.checkOut();
else
cout << "The store does not carry " << title
<< endl;
}
bool videoListType::videoCheckTitle(string title)
{
bool found = false'
nodeType<videoType> *location;
searchVideoList(title, found, location);
return found;
}
void videoListType::videoUpdateInStock(string title, int num)
{
bool found = false;
nodeType<videoType> *location;
searchVideolist(title, found, location);
if (found)
location->info.updateInStock(num);
else
cout << "The store does not carry " << title
<< endl;
}
void videoListType::videoSetCopiesInStock(string title, int num)
{
bool found = false;
nodeType<videoType> *location;
searchVideolist(title, found, location);
if (found)
location->info,.setCopiesInStock(num);
return found;
}
void videoListType::videoPrintTitle() const
{
nodeType<videoType>* current;
current = first;
while (current != NULL)
{
current->info.printTitle();
current = current->link;
}
}
|
and the error codes I just cant get rid of:
In file included from videoListType.h:8,
from main.cpp:6:
unorderedLinkedList.h:13: error: expected template-name before '<' token
unorderedLinkedList.h:13: error: expected `{' before '<' token
unorderedLinkedList.h:13: error: expected unqualified-id before '<' token
unorderedLinkedList.h:13: error: expected `;' before '<' token
In file included from main.cpp:6:
videoListType.h:14: error: invalid use of undefined type `class unorderedLinkedList<videoType>'
unorderedLinkedList.h:13: error: declaration of `class unorderedLinkedList<videoType>'
videoListType.h:34: error: `nodeType' has not been declared
videoListType.h:34: error: expected `,' or `...' before '<' token
videoListType.h:34: error: ISO C++ forbids declaration of `parameter' with no type
main.cpp: In function `int main()':
main.cpp:17: error: expected primary-expression before "int"
main.cpp:17: error: expected `;' before "int"
main.cpp:36: error: `choice' undeclared (first use this function)
main.cpp:36: error: (Each undeclared identifier is reported only once for each function it appears in.)
main.cpp:37: error: `ch' undeclared (first use this function)
main.cpp:87: error: expected `;' before "cout"
main.cpp:103: error: expected primary-expression before "else"
main.cpp:103: error: expected `;' before "else"
main.cpp:117: error: 'class videoListType' has no member named 'print'
main.cpp: In function `void createVideoList(std::ifstream&, videoListType&)':
main.cpp:160: error: `newvideo' undeclared (first use this function)
main.cpp:162: error: 'class videoListType' has no member named 'insertFirst'
main.cpp: At global scope:
main.cpp:184: error: expected constructor, destructor, or type conversion before '(' token
main.cpp:184: error: expected `,' or `;' before '(' token
main.cpp:185: error: expected unqualified-id before "return"
main.cpp:185: error: expected `,' or `;' before "return"
main.cpp:186: error: expected declaration before '}' token
make.exe: *** [main.o] Error 1
Execution terminated