| 1 | /********************************************************************** |
| 2 | |
| 3 | FILENAME: uiuc_menu_record.cpp |
| 4 | |
| 5 | ---------------------------------------------------------------------- |
| 6 | |
| 7 | DESCRIPTION: reads input data for specified aircraft and creates |
| 8 | approporiate data storage space |
| 9 | |
| 10 | ---------------------------------------------------------------------- |
| 11 | |
| 12 | STATUS: alpha version |
| 13 | |
| 14 | ---------------------------------------------------------------------- |
| 15 | |
| 16 | REFERENCES: based on "menu reader" format of Michael Selig |
| 17 | |
| 18 | ---------------------------------------------------------------------- |
| 19 | |
| 20 | HISTORY: 04/04/2003 initial release |
| 21 | 06/30/2003 (RD) replaced istrstream with istringstream |
| 22 | to get rid of the annoying warning about |
| 23 | using the strstream header |
| 24 | 07/17/2003 (RD) to speed up compile time, condensed |
| 25 | code and moved error checking to |
| 26 | uiuc_recorder() |
| 27 | |
| 28 | ---------------------------------------------------------------------- |
| 29 | |
| 30 | AUTHOR(S): Robert Deters <[email protected]> |
| 31 | Michael Selig <[email protected]> |
| 32 | |
| 33 | ---------------------------------------------------------------------- |
| 34 | |
| 35 | VARIABLES: |
| 36 | |
| 37 | ---------------------------------------------------------------------- |
| 38 | |
| 39 | INPUTS: n/a |
| 40 | |
| 41 | ---------------------------------------------------------------------- |
| 42 | |
| 43 | OUTPUTS: n/a |
| 44 | |
| 45 | ---------------------------------------------------------------------- |
| 46 | |
| 47 | CALLED BY: uiuc_menu() |
| 48 | |
| 49 | ---------------------------------------------------------------------- |
| 50 | |
| 51 | CALLS TO: check_float() if needed |
| 52 | d_2_to_3() if needed |
| 53 | d_1_to_2() if needed |
| 54 | i_1_to_2() if needed |
| 55 | d_1_to_1() if needed |
| 56 | |
| 57 | ---------------------------------------------------------------------- |
| 58 | |
| 59 | COPYRIGHT: (C) 2003 by Michael Selig |
| 60 | |
| 61 | This program is free software; you can redistribute it and/or |
| 62 | modify it under the terms of the GNU General Public License |
| 63 | as published by the Free Software Foundation. |
| 64 | |
| 65 | This program is distributed in the hope that it will be useful, |
| 66 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 67 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 68 | GNU General Public License for more details. |
| 69 | |
| 70 | You should have received a copy of the GNU General Public License |
| 71 | along with this program; if not, write to the Free Software |
| 72 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 73 | |
| 74 | **********************************************************************/ |
| 75 | |
| 76 | #include <simgear/compiler.h> |
| 77 | |
| 78 | |
| 79 | #include <cstdlib> |
| 80 | #include <string> |
| 81 | #include <iostream> |
| 82 | |
| 83 | #include "uiuc_menu_record.h" |
| 84 | |
| 85 | using std::string; |
| 86 | using std::istringstream; |
| 87 | using std::cerr; |
| 88 | using std::cout; |
| 89 | using std::endl; |
| 90 | |
| 91 | #ifndef _MSC_VER |
| 92 | using std::exit; |
| 93 | #endif |
| 94 | |
| 95 | void parse_record( const string& linetoken2, const string& linetoken3, |
| 96 | const string& linetoken4, const string& linetoken5, |
| 97 | const string& linetoken6, const string& linetoken7, |
| 98 | const string& linetoken8, const string& linetoken9, |
| 99 | const string& linetoken10, const string& aircraft_directory, |
| 100 | LIST command_line ) { |
| 101 | |
| 102 | istringstream token3(linetoken3.c_str()); |
| 103 | istringstream token4(linetoken4.c_str()); |
| 104 | istringstream token5(linetoken5.c_str()); |
| 105 | istringstream token6(linetoken6.c_str()); |
| 106 | istringstream token7(linetoken7.c_str()); |
| 107 | istringstream token8(linetoken8.c_str()); |
| 108 | istringstream token9(linetoken9.c_str()); |
| 109 | istringstream token10(linetoken10.c_str()); |
| 110 | |
| 111 | //store commands |
| 112 | recordParts -> storeCommands (*command_line); |
| 113 | |
| 114 | } |