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
RevLine 
[82]1#include "userinfo.h"
2
[142]3class IntUI: public ValuedUserInfo<int>
[122]4{
5public:
[82]6
[142]7        void Build(int* &pInstance)
[122]8        {
[142]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()) );
[122]12        }
13
14};
15
[142]16const TypedUserInfo<int>& IntUI::instance = IntUI();
[122]17
18
[142]19class StringUI: public ValuedUserInfo<string>
[122]20{
21public:
[142]22        void Build(string* &pInstance)
[122]23        {
[142]24                pInstance  = &value;
[122]25        }
26};
27
[142]28const TypedUserInfo<string>& StringUI::instance = StringUI();
[122]29
[142]30
[82]31int main()
32{
[142]33        int i = 9, *pi = &i;
[122]34
[142]35        RootElement root("car.xml");
36        root.Load();
[122]37
[142]38        UserInfo::Assembly("clovek",root,pi);
39       
40        //root.Save();
41       
42        cout << "press any key to quit, pi=" << *pi << endl;
43        getchar(); 
[82]44        return 0;
[122]45}
Note: See TracBrowser for help on using the browser.