使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 4905e2e7537d507f218e8e9595485e09d9f3a2b4
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
97
98
99
100
101
102
103
104
105
106
107
108
109
#include "StdAfx.h"
#include "MBCatalogMgr.h"
 
 
CMBCatalogMgr::CMBCatalogMgr(void)
{
     
}
 
 
CMBCatalogMgr::~CMBCatalogMgr(void)
{
     
}
 
bool  CMBCatalogMgr::AddCatalogInfo(CMBCatalogInfo *pCatalogInfo)
{
     
    return AddCatalogObj(pCatalogInfo); 
}
 
// ÒƳýĿ¼
bool   CMBCatalogMgr::RemoveAllCatalogInfo()
{
    return RemoveAllCatalogObj(); 
}
  
CMBBaseCatalogObj  *CMBCatalogMgr::DeepFindCatalogObj( CString &strCatalogID )
{
    CMBBaseCatalogObjMap::iterator    it;
    CMBBaseCatalogObj *pCatalogObj  = NULL;
 
    for( it = m_mapCatalogObj.begin();it != m_mapCatalogObj.end();it++ )
    {
        pCatalogObj = it->second;
        if( pCatalogObj->m_strID == strCatalogID ) 
        {
            return pCatalogObj;
        }else{
            CMBBaseCatalogObj *pObj = ((CMBCatalogInfo*)pCatalogObj)->GetCatalogMgr()->DeepFindCatalogObj(strCatalogID );
            if( pObj != NULL )
                return pObj;
        }
    } 
    return NULL;
}
 
CMBCatalogInfo *CMBCatalogMgr::GetCatalogInfo( CString strID )
{
    return (CMBCatalogInfo *)GetCatalogObj(strID);
}
 
 
bool  CMBCatalogMgr::EmptyMgr()
{
    m_mapCatalogObj.clear(); 
    m_vectorCatalogObj.clear();
    return true;
}
 
bool  CMBCatalogMgr::ParseXml( CString &strXml,CString &strErrInfo )
{
    if( strXml.IsEmpty() )
    {  
        strErrInfo = _T("CMBCatalogMgr::ParseXml,²ÎÊýΪ¿Õ£¡");
        return false;
    }
 
    pugi::xml_document    xmlDoc;
    
    if (!xmlDoc.load(strXml))   
    {  
        return false;
    }   
    pugi::xml_node form  = xmlDoc.child(_T("Body")).child(_T("Catalog")); 
    for(pugi::xml_node node = form; node; node = node.next_sibling(_T("Catalog")))
    {
        CMBCatalogInfo *pCatalogInfo = new CMBCatalogInfo();
        //pCatalogInfo->m_strTreeID    = CStrFileUtils::GenerateGuid();
        pCatalogInfo->m_strID        = node.attribute(_T("ID")).value();
        pCatalogInfo->m_strListType  = node.attribute(_T("ListType")).value();
        pCatalogInfo->m_strOrder     = node.attribute(_T("Order")).value();
          
        CString strSubCount  = node.attribute(_T("SubCount")).value();
        pCatalogInfo->m_nSubCount       = _ttoi(strSubCount);
        CString strFileCount            =   node.attribute(_T("FileCount")).value();
        pCatalogInfo->m_nFileCount      = _ttoi(strFileCount);
        pCatalogInfo->m_strDtCreate     = node.attribute(_T("DTCreate")).value(); 
        pCatalogInfo->m_strHasAce       = node.attribute(_T("HasAce")).value();
        pCatalogInfo->m_strPermit       = node.attribute(_T("Permit")).value();
        pCatalogInfo->m_strGlobalEdit   = node.attribute(_T("GlobalEdit")).value(); 
        pCatalogInfo->m_strMasterID         = node.attribute(_T("MasterID")).value();
        pCatalogInfo->m_strMasterName       = node.attribute(_T("MasterName")).value();
        pCatalogInfo->m_strName             = node.child_value(_T("Name"));  
        
        if( !AddCatalogInfo(pCatalogInfo) )
        {
            // Èç¹û´æÔÚ ÖØÖàbLoadCatalog
            GetCatalogObj( pCatalogInfo->m_strID )->m_bLoadCatalog = false;
            GetCatalogObj( pCatalogInfo->m_strID )->m_nSubCount = pCatalogInfo->m_nSubCount;
            GetCatalogObj( pCatalogInfo->m_strID )->m_nFileCount = pCatalogInfo->m_nFileCount;
            delete pCatalogInfo;
            pCatalogInfo = NULL;
        }
    } 
     
    return true;
 
}