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

This commit is contained in:
2018-02-14 14:16:16 +00:00
parent 215e1a38f2
commit 602628334a
2 changed files with 70 additions and 8 deletions

View File

@@ -1,7 +1,34 @@
#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[]) {
piCout << "Hello VS!";
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;