git-svn-id: svn://db.shs.com.ru/pip@603 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2018-04-02 13:42:39 +00:00
parent d94b7a6372
commit 72f91ac5b7
5 changed files with 23 additions and 125 deletions

View File

@@ -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;