Source for user.cpp for Part 5

This document shows the contents of user.cpp if you are starting the tutorial in Part 5. Debugging and Revising Your Application.

IString User::Action() {
   IString Action=IString::lowerCase(Req->GetValue("op"));
   if (Action=="") return Error("No Action Specified", "The CGI call did not specify an op= argument.");
   switch (Action[1]) {
      case 'a':
         if (Action=="add") return Add();
         break;
      case 'c':
         if (Action=="complete") return Complete();
         break;
      case 's':
         if (Action=="showadd") return ShowAdd();
         break;
      case 'v':
         if (Action=="view") return View();
   }
   return Error("Unknown Action Specified","The CGI call requested an unknown action, "+Action);
}

IString Reader::View() {
   return Error("Unimplemented","Reader::View is not yet implemented");
}

IString Reviewer::Add() {
   return Error("Unimplemented","Reviewer::Add is not yet implemented");
}

IString Reviewer::ShowAdd() {
   return Error("Unimplemented","Reviewer::ShowAdd is not yet implemented");
}

IString Reviewer::View() {
   return Error("Unimplemented","Reviewer::View is not yet implemented");
}

IString Author::View() {
   return Error("Unimplemented","Author::View is not yet implemented");
}
IString Author::Complete() {
   return Error("Unimplemented","Author::Complete is not yet implemented");
}