使用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
#include "StdAfx.h"
#include "MBQueryDmsCatalogMgr.h"
 
 
CMBQueryDmsCatalogMgr::CMBQueryDmsCatalogMgr(void)
{
     
}
 
 
CMBQueryDmsCatalogMgr::~CMBQueryDmsCatalogMgr(void)
{
     
}
 
bool  CMBQueryDmsCatalogMgr::AddCatalog(CMBQueryDmsCatalog *pCatalog)
{
     
    return AddCatalogObj(pCatalog); 
}
 
// ÒƳýĿ¼
bool   CMBQueryDmsCatalogMgr::RemoveAllCatalog()
{
    return RemoveAllCatalogObj(); 
}
 
 
bool  CMBQueryDmsCatalogMgr::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")))
    {
        CMBQueryDmsCatalog *pCatalogInfo = new CMBQueryDmsCatalog();
        //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( !AddCatalog(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;
 
}