root/tests/testUI.cpp @ 142

Revision 142, 0.7 kB (checked in by mido, 16 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
3class IntUI: public ValuedUserInfo<int>
4{
5public:
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
16const TypedUserInfo<int>& IntUI::instance = IntUI();
17
18
19class StringUI: public ValuedUserInfo<string>
20{
21public:
22        void Build(string* &pInstance)
23        {
24                pInstance  = &value;
25        }
26};
27
28const TypedUserInfo<string>& StringUI::instance = StringUI();
29
30
31int 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}
Note: See TracBrowser for help on using the browser.