Fixed the Wii port so that it compiles.
[rpn.git] / src / Help.cpp
blobfb0b7727cf20ccba34d58e17a8652bdd745f570b
1 /*******************************************************************************
2 * Reverse Polish Notation calculator. *
3 * Copyright (c) 2007-2008, Samuel Fredrickson <kinghajj@gmail.com> *
4 * All rights reserved. *
5 * *
6 * Redistribution and use in source and binary forms, with or without *
7 * modification, are permitted provided that the following conditions are met: *
8 * * Redistributions of source code must retain the above copyright *
9 * notice, this list of conditions and the following disclaimer. *
10 * * Redistributions in binary form must reproduce the above copyright *
11 * notice, this list of conditions and the following disclaimer in the *
12 * documentation and/or other materials provided with the distribution. *
13 * *
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS *
15 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
17 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY *
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR *
20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *
21 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY *
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
24 * DAMAGE. *
25 ******************************************************************************/
27 /*******************************************************************************
28 * Help.cpp - the help module for the console port. *
29 ******************************************************************************/
31 #include "rpn.h"
32 #include <boost/foreach.hpp>
33 using namespace RPN;
34 using namespace std;
36 void RPN::printHelpItems(const HelpItems& items)
38 BOOST_FOREACH(const HelpItem& item, items)
40 Print(" ");
41 Print(item.Brief());
42 Print("\n ");
43 Print(item.Description());
44 Print("\n");
48 HelpItems RPN::defaultHelpItems()
50 HelpItems items;
52 items.push_back(HelpItem("+, -, *, /, **, sqrt, =",
53 "The basic math operators."));
54 items.push_back(HelpItem("%, ^, &, |",
55 "Modulo and bitwise operators."));
56 items.push_back(HelpItem("dup", "Pushes the topmost value to the stack."));
57 items.push_back(HelpItem("pop", "Removes the topmost value of the stack."));
58 items.push_back(HelpItem("ph", "Prints the history stack."));
59 items.push_back(HelpItem("phd", "Prints the history stack in detail."));
60 items.push_back(HelpItem("ps", "Prints the stack."));
61 items.push_back(HelpItem("psd", "Prints the stack in detail."));
62 items.push_back(HelpItem("ph", "Prints the variable map."));
63 items.push_back(HelpItem("phd", "Prints the variable map in detail."));
64 items.push_back(HelpItem("x", "Exits the program."));
66 return items;