Revision 142, 0.7 kB
(checked in by mido, 17 years ago)
|
UI - jen jako zaloha, jeste nehotove, nicmene build by mel projit
|
-
Property svn:eol-style set to
native
|
Line | |
---|
1 | #include "userinfo.h" |
---|
2 | |
---|
3 | class IntUI: public ValuedUserInfo<int> |
---|
4 | { |
---|
5 | public: |
---|
6 | |
---|
7 | void Build(int* &pInstance) |
---|
8 | { |
---|
9 | // KDO SE POSTARA O DEALOKACI TOHOTO? NADRAZENE UI? ASI.. |
---|
10 | // PAK TO CHCE ALE OBDOBNE UDELAT I STRING NIZE, ZKOPIROVAT atd |
---|
11 | pInstance = new int( atoi( value.c_str()) ); |
---|
12 | } |
---|
13 | |
---|
14 | }; |
---|
15 | |
---|
16 | const TypedUserInfo<int>& IntUI::instance = IntUI(); |
---|
17 | |
---|
18 | |
---|
19 | class StringUI: public ValuedUserInfo<string> |
---|
20 | { |
---|
21 | public: |
---|
22 | void Build(string* &pInstance) |
---|
23 | { |
---|
24 | pInstance = &value; |
---|
25 | } |
---|
26 | }; |
---|
27 | |
---|
28 | const TypedUserInfo<string>& StringUI::instance = StringUI(); |
---|
29 | |
---|
30 | |
---|
31 | int main() |
---|
32 | { |
---|
33 | int i = 9, *pi = &i; |
---|
34 | |
---|
35 | RootElement root("car.xml"); |
---|
36 | root.Load(); |
---|
37 | |
---|
38 | UserInfo::Assembly("clovek",root,pi); |
---|
39 | |
---|
40 | //root.Save(); |
---|
41 | |
---|
42 | cout << "press any key to quit, pi=" << *pi << endl; |
---|
43 | getchar(); |
---|
44 | return 0; |
---|
45 | } |
---|