Files Classes Functions Hierarchy
#include <viscmd.h>
Public Member Functions | |
| viscmd (stringc command_, stringc arg_) | |
| Explicitly construct. | |
| viscmd () | |
| Construct in bad state - for STL. | |
| operator string () const | |
| Serialize as xml. | |
| void | serializeInverse (stringc &s) |
| Interpret xml string eg <viscmd><command>point2</command><arg>2.0 1.0</arg><valid>1</valid></viscmd>. | |
Static Public Member Functions | |
| static void | printstatusinvalid (vector< viscmd > &v) |
| Print to cout invalid commands. | |
Public Attributes | |
| string | command |
| Command id. | |
| string | arg |
| Argument string. | |
| bool | valid |
| Was the command run successfully? | |
| bool | enabled |
| Is this command enabled - used for toggling graphics. | |
Definition at line 15 of file viscmd.h.
| viscmd::viscmd | ( | ) |
| viscmd::operator string | ( | ) | const |
Serialize as xml.
Definition at line 18 of file viscmd.cpp.
References arg, command, enabled, and valid.
00019 { 00020 string s; 00021 s = "<viscmd><command>"; 00022 s += command; 00023 s += "</command><arg>"; 00024 s += arg; 00025 s += "</arg><valid>"; 00026 if (valid) 00027 s += "1"; 00028 else 00029 s += "0"; 00030 s += "</valid>"; 00031 s += "<enabled>"; 00032 if (enabled) 00033 s += "1"; 00034 else 00035 s += "0"; 00036 s += "</enabled>"; 00037 s += "</viscmd>"; 00038 ; 00039 return s; 00040 }
| void viscmd::printstatusinvalid | ( | vector< viscmd > & | v | ) | [static] |
Print to cout invalid commands.
Definition at line 65 of file viscmd.cpp.
References valid.
Referenced by vistest::test02().
00067 { 00068 for (uint i=0; i<v.size(); ++i) 00069 { 00070 if (v[i].valid==false) 00071 cout << (string)(v[i]) << endl; 00072 } 00073 }
| void viscmd::serializeInverse | ( | stringc & | s | ) |
Interpret xml string eg <viscmd><command>point2</command><arg>2.0 1.0</arg><valid>1</valid></viscmd>.
Definition at line 42 of file viscmd.cpp.
| string viscmd::arg |
Argument string.
Definition at line 23 of file viscmd.h.
Referenced by vispointxml::handlecommand(), vispoint3::handlecommand(), vispoint2::handlecommand(), visline::handlecommand(), visconvex::handlecommand(), and operator string().
| string viscmd::command |
Command id.
Definition at line 20 of file viscmd.h.
Referenced by vispointxml::handlecommand(), vispoint3::handlecommand(), vispoint2::handlecommand(), visline::handlecommand(), visconvex::handlecommand(), and operator string().
Is this command enabled - used for toggling graphics.
Definition at line 28 of file viscmd.h.
Referenced by operator string().
Was the command run successfully?
Definition at line 26 of file viscmd.h.
Referenced by vispointxml::handlecommand(), vispoint3::handlecommand(), vispoint2::handlecommand(), visline::handlecommand(), visconvex::handlecommand(), operator string(), and printstatusinvalid().
1.5.8