Commit b877df22 authored by Ivan.Shulga's avatar Ivan.Shulga Committed by Alexander Trofimov

linux build

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58193 954022d7-b5bf-4e40-9824-e11837661b57
parent d2140a00
......@@ -11,7 +11,7 @@ TEMPLATE = lib
CONFIG += staticlib
QMAKE_CXXFLAGS += -std=c++11
DEFINES += UNICODE _USE_LIBXML2_READER_ _LINUX_QT
DEFINES += UNICODE _UNICODE _USE_LIBXML2_READER_ _LINUX_QT
LIBS += -lxml2
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.1.1, 2014-09-05T19:17:40. -->
<!-- Written by QtCreator 3.1.1, 2014-09-09T19:44:55. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
......
......@@ -4192,4 +4192,23 @@ typedef const wchar_t* LPCWSTR;
#endif // _WIN32
#ifndef itoa
#include <cstdio>
static void itoa (int value, char *str, int base) {
switch (base){
case 10:
sprintf(str, "%d", value);
break;
case 16:
sprintf(str, "%x", value);
break;
case 8:
sprintf(str, "%o", value);
break;
}
}
#endif
#endif // ASCSTRING_H
......@@ -128,6 +128,13 @@ namespace NSCommon
return *this;
}
#endif
nullable<Type>& operator=(const std::wstring& cwsValue)
{
RELEASEOBJECT(this->m_pPointer);
this->m_pPointer = new Type( cwsValue.c_str() );
return *this;
}
nullable<Type>& operator=(const nullable<Type> &oOther)
{
RELEASEOBJECT(this->m_pPointer);
......
......@@ -64,7 +64,7 @@ namespace SimpleTypes
#define SimpleType_Operator_Equal(Class) \
Class(const BSTR &bsValue)\
{\
FromString( bsValue );\
/*FromString( bsValue );*/\
}\
Class(CString &sValue)\
{\
......@@ -85,7 +85,7 @@ namespace SimpleTypes
}\
const Class &operator =(const BSTR &bsValue)\
{\
FromString( bsValue );\
/*FromString( bsValue );*/\
return *this;\
}\
const Class &operator =(const wchar_t* cwsString)\
......
......@@ -2581,7 +2581,7 @@ namespace SimpleTypes
else
{
/*
// , , word .
//CHighlightColor<highlightcolorNone> oHighlightColor(sValue);
CHighlightColor<> oHighlightColor(sValue);
......@@ -2605,7 +2605,7 @@ namespace SimpleTypes
Parse3();
}
else this->m_eValue = eDefValue;
*/
}
return this->m_eValue;
......
......@@ -646,4 +646,25 @@ namespace XmlUtils
return strNodeName;
return strNodeName.Mid(nFind + 1);
}
}
\ No newline at end of file
// CXmlNodes
CXmlNodes::CXmlNodes() : m_nodes()
{
}
BOOL CXmlNodes::IsValid()
{
return TRUE;
}
int CXmlNodes::GetCount()
{
return (int)m_nodes.size();
}
bool CXmlNodes::GetAt(int nIndex, CXmlNode& oXmlNode)
{
if (nIndex < 0 && nIndex >= GetCount())
return false;
oXmlNode = m_nodes[nIndex];
return true;
}
}
......@@ -738,7 +738,22 @@ namespace XmlUtils
void GetXml(CStringWriter& oWriter);
};
class CXmlNodes;
class CXmlNode;
class CXmlNodes
{
private:
std::vector<CXmlNode> m_nodes;
public:
CXmlNodes();
BOOL IsValid();
int GetCount();
bool GetAt(int nIndex, CXmlNode& oXmlNode);
friend class CXmlNode;
};
class CXmlNode
{
private:
......@@ -829,25 +844,34 @@ namespace XmlUtils
CString GetAttributeOrValue(const CString& strAttributeName, const CString& strDefaultValue = _T(""));
/*
void LoadArray(const CString& sName, std::vector<T>& arList)
{
if (GetNodes(sName, oNodes))
}
*/
template <typename T>
void LoadArray(const CString& sName, CAtlArray<T>& arList)
void LoadArray(const CString& sName, std::vector<T>& arList)
{
CXmlNodes oNodes;
if (GetNodes(sName, oNodes))
{
{
int nCount = oNodes.GetCount();
for (int i = 0; i < nCount; ++i)
{
CXmlNode oItem;
oNodes.GetAt(i, oItem);
arList.Add();
arList[i].fromXML(oItem);
//arList.Add ();
//arList[i].fromXML(oItem);
arList.push_back(T());
arList[i].fromXML(oItem);
}
}
}
template <typename T>
void LoadArray(const CString& sName, const CString& sSubName, CAtlArray<T>& arList)
void LoadArray(const CString& sName, const CString& sSubName, std::vector<T>& arList)
{
CXmlNode oNode;
if (GetNode(sName, oNode))
......@@ -874,34 +898,7 @@ namespace XmlUtils
CString private_GetXmlFast(const CString& strDefaultValue);
};
class CXmlNodes
{
private:
std::vector<CXmlNode> m_nodes;
public:
CXmlNodes() : m_nodes()
{
}
BOOL IsValid()
{
return TRUE;
}
int GetCount()
{
return (int)m_nodes.size();
}
bool GetAt(int nIndex, CXmlNode& oXmlNode)
{
if (nIndex < 0 && nIndex >= GetCount())
return false;
oXmlNode = m_nodes[nIndex];
return true;
}
friend class CXmlNode;
};
}
#if 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment