使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 0408576e9da10015ffa9da0079b8c985113ce4b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include "StdAfx.h"
#include "MBTNXXXXXXFieldMgr.h"
 
 
CMBTNXXXXXXFieldMgr::CMBTNXXXXXXFieldMgr(void)
{
    RemoveAll();
}
 
 
CMBTNXXXXXXFieldMgr::~CMBTNXXXXXXFieldMgr(void)
{
    RemoveAll();
}
 
void                 CMBTNXXXXXXFieldMgr::GetVector( CMBTNXXXXXXFiledVector &vector)
{
    vector.clear();
    vector = m_vector;
}
 
CMBTNXXXXXXFiled      *CMBTNXXXXXXFieldMgr::Get( CString strField )
{
    if( strField.IsEmpty() )
        return NULL;
 
    CMBTNXXXXXXFiledMap::iterator    it; 
    CMBTNXXXXXXFiled *pFiled  = NULL;
 
    it = m_map.find(strField);
 
    if( it!= m_map.end() )
        pFiled = it->second;
 
    return pFiled;   
}
 
bool                 CMBTNXXXXXXFieldMgr::Add( CMBTNXXXXXXFiled *pFiled )
{
    if( NULL ==  pFiled || pFiled->m_strFiled.IsEmpty() )
        return false;
 
    CMBTNXXXXXXFiledMap::iterator    it; 
    CString strField;
 
    strField = pFiled->m_strFiled;
    it = m_map.find(strField);
 
    // Èç¹ûÕҵõ½ ·µ»Ø
    if( it != m_map.end() )
        return false;
 
    m_map[strField] = pFiled;     
    m_vector.push_back(pFiled);
 
    return true; 
}
 
bool             CMBTNXXXXXXFieldMgr::RemoveAll()
{
    CMBTNXXXXXXFiledMap::iterator    it; 
    CMBTNXXXXXXFiled *pFiled  = NULL;
 
    for( it = m_map.begin();it != m_map.end();it++ )
    {
        pFiled = it->second;
        delete pFiled;
        pFiled = NULL;        
    }
 
    m_map.clear();  
    m_vector.clear();
 
    return true;
}
 
//<dymfield></
CString        CMBTNXXXXXXFieldMgr::GenXml()
    CMBTNXXXXXXFiledMap::iterator    it; 
    CMBTNXXXXXXFiled *pFiled  = NULL;
 
    CString strXml,strAttrs,strAttr;
 
    for( it = m_map.begin();it != m_map.end();it++ )
    {
        pFiled = it->second;
        strAttr.Format(_T("<Attr Name='%s'>%s</Attr>"),pFiled->m_strFiled,pFiled->m_strValue);
        strAttrs += strAttr;
    }
 
    if(!strAttrs.IsEmpty())
        strXml.Format(_T("<Attrs>%s</Attrs>"),strAttrs);
 
    return strXml;
}