git-svn-id: svn://db.shs.com.ru/pip@603 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
28
main.cpp
28
main.cpp
@@ -1,34 +1,6 @@
|
||||
#include "pip.h"
|
||||
|
||||
struct S {
|
||||
S() {
|
||||
_int = -66;
|
||||
int_v << 1 << 2;
|
||||
d = 10.5;
|
||||
str = "S String";
|
||||
}
|
||||
int _int;
|
||||
PIVector<int> int_v;
|
||||
double d;
|
||||
PIString str;
|
||||
};
|
||||
|
||||
PIByteArray getMember(const S * p, const char * name) {
|
||||
PIByteArray ret;
|
||||
if (!p || !name) return ret;
|
||||
if (strcmp(name, "_int") == 0) ret << p->_int;
|
||||
if (strcmp(name, "int_v") == 0) ret << p->int_v;
|
||||
if (strcmp(name, "d") == 0) ret << p->d;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
S s;
|
||||
s.int_v <<777;
|
||||
PIByteArray ba = getMember(&s, "int_v");
|
||||
piCout << PICoutManipulators::Hex << ba;
|
||||
PIVector<int> i; ba >> i;
|
||||
piCout << i;
|
||||
//S s;
|
||||
//s.i;
|
||||
//PICodeParser cp;
|
||||
|
||||
Reference in New Issue
Block a user