//////////////////////////////////////////////////////////////////////////
| 75 | |
| 76 | /////////////////////////////////////////////////////////////////////////////// |
| 77 | int main() |
| 78 | { |
| 79 | std::cout << "/////////////////////////////////////////////////////////\n\n"; |
| 80 | std::cout << "\t\tParsing into a QString from Spirit...\n\n"; |
| 81 | std::cout << "/////////////////////////////////////////////////////////\n\n"; |
| 82 | |
| 83 | std::cout << "Give me a complex number of the form r or (r) or (r,i) \n"; |
| 84 | std::cout << "Type [q or Q] to quit\n\n"; |
| 85 | |
| 86 | std::string str; |
| 87 | while (getline(std::cin, str)) |
| 88 | { |
| 89 | if (str.empty() || str[0] == 'q' || str[0] == 'Q') |
| 90 | break; |
| 91 | |
| 92 | QString t; |
| 93 | if (client::parse_qstring(str.begin(), str.end(), t)) |
| 94 | { |
| 95 | std::cout << "-------------------------\n"; |
| 96 | std::cout << "Parsing succeeded\n"; |
| 97 | std::cout << "got: " << t.toStdString() << std::endl; |
| 98 | std::cout << "\n-------------------------\n"; |
| 99 | } |
| 100 | else |
| 101 | { |
| 102 | std::cout << "-------------------------\n"; |
| 103 | std::cout << "Parsing failed\n"; |
| 104 | std::cout << "-------------------------\n"; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | std::cout << "Bye... :-) \n\n"; |
| 109 | return 0; |
| 110 | } |
| 111 | |
| 112 |
nothing calls this directly
no test coverage detected