使用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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#include "StdAfx.h"
#include "MBBaseDocObj.h"
 
IMPLEMENT_DYNAMIC(CMBBaseDocObj, CMBAbstBaseObj)
 
CMBBaseDocObj::CMBBaseDocObj(void)
    m_bGetDocInfo         = false;
    m_nSecretLvl         = 0;
    m_nFileSize             = 0;
    m_nFakeType             = DOC_NONE; 
}
 
 
CMBBaseDocObj::~CMBBaseDocObj(void)
{
 
}
 
CString CMBBaseDocObj::GetThumbUrlID(  )
{
    int nDotPos       = m_strThumbURL.ReverseFind(_T('.'));
    int nSlashPos     = m_strThumbURL.ReverseFind(_T('\\'));   
    if( nDotPos == -1 || nSlashPos == -1 )
        return _T("");
 
    return m_strThumbURL.Mid(nSlashPos+1,nDotPos-nSlashPos-1);
}
 
 bool  CMBBaseDocObj::GetTags(CStringArray  &arTags)
 {
    CMBStrOper::SplitString(m_strTags,_T(';'),arTags);
 
    return true;
 }
 
 bool  CMBBaseDocObj::AddTags( CString strTags )
 {
     if( m_strTags.IsEmpty() )
     {
        m_strTags += strTags;
        return true;
     }        
 
     int nPos = m_strTags.ReverseFind(_T(';'));
     if( nPos == (m_strTags.GetLength() -1) )
     {
        m_strTags += strTags;
     }else{
        m_strTags += _T(";");
        m_strTags += strTags;
     } 
    return true;
 }
 
 bool CMBBaseDocObj::RemoveTag( CString strTag )
 {
    CString strTags;
    CStringArray  arTags;
    GetTags(arTags);
    for( int i = 0; i< arTags.GetCount();i++ )
    {
        CString strTmpTag = arTags[i];
        if(strTmpTag == strTag )
            continue;
        strTags += strTmpTag;
        strTags += _T(";");
    }
    m_strTags = strTags;
    return true;
 }
 
bool CMBBaseDocObj::IsInTags( CString strTag )
{
    CStringArray  arTags;
    GetTags(arTags);
    for( int i = 0; i< arTags.GetCount();i++ )
    {
        CString strTmpTag = arTags[i];
        if(strTmpTag == strTag )
            return true;
    }
    return false;
}
 
bool CMBBaseDocObj::IsLock()
{
    m_strLocker = m_strLocker.Trim();
 
    if( m_strLocker.IsEmpty() )
        return false;
 
    return true;
}
 
bool CMBBaseDocObj::ParseXML(CString &strXML,CString &strErrInfo)
{
    if( strXML.IsEmpty() )
    {         
        m_nSecretLvl = 10000;  // ËµÃ÷ µ÷ÓÃGetDocInfoûÓзµ»ØÈκÎÐÅÏ¢,ÉèÖÃΪ10000£¬Ãܼ¶ºÜ´óµÄÒâ˼
        return true;
    }
    pugi::xml_document    xmlDoc;    
    if (!xmlDoc.load(strXML))   
    {   
        return false;
    }   
    CString strSecretLvl;  // Ãܼ¶
    CString strName; 
 
    pugi::xml_node form  = xmlDoc.child(_T("Doc")); 
    pugi::xml_node node = form; 
    strName                 = node.child_value(_T("Name"));
    if( !strName.IsEmpty() )
    {
        m_strName = strName;
    }       
    m_strCanDownload     = node.attribute(_T("CanDownload")).value();
    m_strVID             = node.attribute(_T("VID")).value();
    m_strVer             = node.attribute(_T("Ver")).value();
    strSecretLvl         = node.attribute(_T("SecretLvl")).value();
    m_nSecretLvl         = _ttoi(strSecretLvl);
    m_strSecretName      = node.attribute(_T("SecretName")).value();
    m_strCreatorName     = node.attribute(_T("CreatorName")).value();
    m_strDTCreate        = node.attribute(_T("DTCreate")).value();
    m_strModifier        = node.attribute(_T("Modifier")).value();
    m_strModifierName    = node.attribute(_T("ModifierName")).value();
    m_strDTModify        = node.attribute(_T("DTModify")).value();     
    m_strFileMD5         = node.attribute(_T("FileMD5")).value();     
    m_strFileServer      = node.attribute(_T("FileServer")).value();
    m_strFileID          = node.attribute(_T("FileID")).value();
    m_strPdfFileID       = node.attribute(_T("PdfFileID")).value();
    m_strSwfFileID       = node.attribute(_T("SwfFileID")).value(); 
    m_strThumbFileID     = node.attribute(_T("ThumbFileID")).value();  
    m_strCanEdit         = node.attribute(_T("CanEdit")).value();
    m_strVersion         = node.attribute(_T("Version")).value(); 
 
 
    return true; 
}