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

ubuntu build (not finished)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@57769 954022d7-b5bf-4e40-9824-e11837661b57
parent 4384cfc1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.1.1, 2014-07-31T19:39:40. -->
<!-- Written by QtCreator 3.1.1, 2014-08-07T16:23:35. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
......
......@@ -4174,6 +4174,7 @@ struct StdStringEqualsNoCaseA
#ifdef UNICODE
typedef CStdStringW CStringW;
typedef CStringW CString;
typedef CStringW BSTR;
#define __T(x) L ## x
#else // UNICODE
typedef CStdStringA CStringA;
......
......@@ -61,6 +61,7 @@ using namespace ATL;
#include "ASCString.h"
#include "stdint.h"
/*
typedef int BOOL;
static const BOOL TRUE = 1;
static const BOOL FALSE = 0;
......@@ -80,6 +81,22 @@ typedef unsigned long long ULONG64;
typedef long long LONG64;
typedef wchar_t WCHAR;
*/
#ifndef _wtof
#include <string>
#define _wtof std::stod
#define _wtoi std::stoi
#define _wtoi64(p) std::wcstoll((p),NULL,10)
#ifdef UNICODE
#define _ttoi _wtoi
#define _stscanf swscanf
#else
#define _ttoi atoi
#define _stscanf scanf
#endif // #ifdef UNICODE
#endif // #ifndef _wtof
#endif // #ifdef _WIN32
#ifndef AVSINLINE
......
#pragma once
#include "SmartPtr.h"
#include "../XML/XmlUtils.h"
#include "../XML/xmlutils.h"
// -
// - -.
......@@ -9,7 +9,7 @@
namespace NSCommon
{
template<typename Type>
template<class Type>
class nullable_base
{
protected:
......@@ -81,7 +81,7 @@ namespace NSCommon
}
};
template<typename Type>
template<class Type>
class nullable : public nullable_base<Type>
{
public:
......@@ -91,16 +91,16 @@ namespace NSCommon
nullable(const nullable<Type>& oOther)
{
if ( NULL == oOther.m_pPointer )
m_pPointer = NULL;
this->m_pPointer = NULL;
else
m_pPointer = new Type( (const Type&)*(oOther.m_pPointer) );
this->m_pPointer = new Type( (const Type&)*(oOther.m_pPointer) );
}
AVSINLINE void operator=(XmlUtils::CXmlNode& oNode)
{
RELEASEOBJECT(m_pPointer);
RELEASEOBJECT(this->m_pPointer);
if (oNode.IsValid())
m_pPointer = new Type(oNode);
this->m_pPointer = new Type(oNode);
}
#ifdef _USE_XMLLITE_READER_
AVSINLINE void operator=(XmlUtils::CXmlLiteReader& oReader)
......@@ -112,102 +112,102 @@ namespace NSCommon
#endif
AVSINLINE void operator=(const wchar_t* &cwsValue)
{
RELEASEOBJECT(m_pPointer);
RELEASEOBJECT(this->m_pPointer);
if (NULL != cwsValue)
m_pPointer = new Type( cwsValue );
this->m_pPointer = new Type( cwsValue );
}
AVSINLINE void operator=(const BSTR &value)
{
RELEASEOBJECT(m_pPointer);
RELEASEOBJECT(this->m_pPointer);
if (NULL != value)
m_pPointer = new Type( value );
this->m_pPointer = new Type( value );
}
nullable<Type>& operator=(const nullable<Type> &oOther)
{
RELEASEOBJECT(m_pPointer);
RELEASEOBJECT(this->m_pPointer);
if ( NULL != oOther.m_pPointer )
m_pPointer = new Type( (const Type&)*(oOther.m_pPointer) );
this->m_pPointer = new Type( (const Type&)*(oOther.m_pPointer) );
return *this;
}
nullable<Type>& operator=(Type* pType)
{
RELEASEOBJECT(m_pPointer);
m_pPointer = pType;
RELEASEOBJECT(this->m_pPointer);
this->m_pPointer = pType;
return *this;
}
nullable<Type>& operator=(const Type& oSrc)
{
RELEASEOBJECT(m_pPointer);
m_pPointer = new Type(oSrc);
RELEASEOBJECT(this->m_pPointer);
this->m_pPointer = new Type(oSrc);
return *this;
}
const bool operator==(const nullable<Type>& oOther) const
{
if ( !m_pPointer && !oOther.m_pPointer )
if ( !this->m_pPointer && !oOther.m_pPointer )
return true;
else if ( !m_pPointer || !oOther.m_pPointer )
else if ( !this->m_pPointer || !oOther.m_pPointer )
return false;
return (*m_pPointer) == (*(oOther.m_pPointer));
return (*this->m_pPointer) == (*(oOther.m_pPointer));
}
const bool operator==(const Type& oOther) const
{
if ( !m_pPointer )
if ( !this->m_pPointer )
return false;
return (*m_pPointer) == oOther;
return (*this->m_pPointer) == oOther;
}
AVSINLINE Type& operator*() { return *m_pPointer; }
AVSINLINE Type* operator->() { return m_pPointer; }
AVSINLINE Type& operator*() { return *this->m_pPointer; }
AVSINLINE Type* operator->() { return this->m_pPointer; }
AVSINLINE Type& operator*() const { return *m_pPointer; }
AVSINLINE Type* operator->() const { return m_pPointer; }
AVSINLINE Type& operator*() const { return *this->m_pPointer; }
AVSINLINE Type* operator->() const { return this->m_pPointer; }
AVSINLINE const Type& get()const { return *m_pPointer; }
AVSINLINE Type& get2()const { return *m_pPointer; }
AVSINLINE const Type& get()const { return *this->m_pPointer; }
AVSINLINE Type& get2()const { return *this->m_pPointer; }
template<class T> const bool is()const
{
if (NULL == m_pPointer)
if (NULL == this->m_pPointer)
return false;
T* pResult = dynamic_cast<T*>(const_cast<Type*>(m_pPointer));
T* pResult = dynamic_cast<T*>(const_cast<Type*>(this->m_pPointer));
return (NULL != pResult);
}
template<class T> const T& as()const
{
T* pResult = dynamic_cast<T*>(const_cast<Type*>(m_pPointer));
T* pResult = dynamic_cast<T*>(const_cast<Type*>(this->m_pPointer));
return *pResult;
}
template<class T> T& as()
{
T* pResult = dynamic_cast<T*>(const_cast<Type*>(m_pPointer));
T* pResult = dynamic_cast<T*>(const_cast<Type*>(this->m_pPointer));
return *pResult;
}
AVSINLINE bool Init()
{
RELEASEOBJECT(m_pPointer);
RELEASEOBJECT(this->m_pPointer);
m_pPointer = new Type;
this->m_pPointer = new Type;
return IsInit();
return this->IsInit();
}
Type* GetPointer() const
{
return m_pPointer;
return this->m_pPointer;
}
//GetPointerEmptyNullable - ,
// nullable,
Type* GetPointerEmptyNullable()
{
Type* pOldPointer = m_pPointer;
m_pPointer = NULL;
Type* pOldPointer = this->m_pPointer;
this->m_pPointer = NULL;
return pOldPointer;
}
};
......@@ -224,29 +224,31 @@ namespace NSCommon
AVSINLINE void operator=(const CString& value)
{
RELEASEOBJECT(m_pPointer);
m_pPointer = new Type();
m_pPointer->_set(value);
RELEASEOBJECT(this->m_pPointer);
this->m_pPointer = new Type();
this->m_pPointer->_set(value);
}
AVSINLINE void operator=(Type* pType)
{
RELEASEOBJECT(m_pPointer);
m_pPointer = pType;
RELEASEOBJECT(this->m_pPointer);
this->m_pPointer = pType;
}
#ifdef _WIN32
AVSINLINE void operator=(const BSTR& value)
{
RELEASEOBJECT(m_pPointer);
RELEASEOBJECT(this->m_pPointer);
if (NULL != value)
{
m_pPointer = new Type();
m_pPointer->_set((CString)value);
this->m_pPointer = new Type();
this->m_pPointer->_set((CString)value);
}
}
#endif
AVSINLINE void operator=(const BYTE& value)
{
RELEASEOBJECT(m_pPointer);
m_pPointer = new Type();
m_pPointer->SetBYTECode(value);
RELEASEOBJECT(this->m_pPointer);
this->m_pPointer = new Type();
this->m_pPointer->SetBYTECode(value);
}
AVSINLINE void operator=(const Type& value)
......@@ -256,12 +258,12 @@ namespace NSCommon
nullable_limit<Type>& operator=(const nullable_limit<Type>& oSrc)
{
RELEASEOBJECT(m_pPointer);
RELEASEOBJECT(this->m_pPointer);
if ( NULL != oSrc.m_pPointer )
{
m_pPointer = new Type();
m_pPointer->set(oSrc->get());
this->m_pPointer = new Type();
this->m_pPointer->set(oSrc->get());
}
return *this;
......@@ -269,23 +271,23 @@ namespace NSCommon
AVSINLINE const CString& get_value_or(const CString& value) const
{
if (NULL == m_pPointer)
if (NULL == this->m_pPointer)
return value;
return m_pPointer->get();
return this->m_pPointer->get();
}
AVSINLINE const CString& get_value() const
{
return m_pPointer->get();
return this->m_pPointer->get();
}
public:
AVSINLINE Type& operator*() { return *m_pPointer; }
AVSINLINE Type* operator->() { return m_pPointer; }
AVSINLINE Type& operator*() { return *this->m_pPointer; }
AVSINLINE Type* operator->() { return this->m_pPointer; }
AVSINLINE Type& operator*() const { return *m_pPointer; }
AVSINLINE Type* operator->() const { return m_pPointer; }
AVSINLINE Type& operator*() const { return *this->m_pPointer; }
AVSINLINE Type* operator->() const { return this->m_pPointer; }
AVSINLINE const Type& get()const { return *m_pPointer; }
AVSINLINE const Type& get()const { return *this->m_pPointer; }
};
class nullable_int : public nullable_base<int>
......@@ -313,23 +315,24 @@ namespace NSCommon
*m_pPointer = 0;
}
}
#ifdef _WIN32
AVSINLINE void operator=(const BSTR& value)
{
RELEASEOBJECT(m_pPointer);
RELEASEOBJECT(this->m_pPointer);
if (NULL != value)
m_pPointer = new int(XmlUtils::GetInteger(value));
this->m_pPointer = new int(XmlUtils::GetInteger(value));
}
#endif
AVSINLINE void operator=(const CString& value)
{
RELEASEOBJECT(m_pPointer);
m_pPointer = new int(XmlUtils::GetInteger(value));
RELEASEOBJECT(this->m_pPointer);
this->m_pPointer = new int(XmlUtils::GetInteger(value));
}
AVSINLINE void operator=(const int& value)
{
RELEASEOBJECT(m_pPointer);
m_pPointer = new int(value);
RELEASEOBJECT(this->m_pPointer);
this->m_pPointer = new int(value);
}
nullable_int& operator=(const nullable_int& oSrc)
......@@ -562,13 +565,14 @@ namespace NSCommon
else
m_pPointer = new CString( *oOther.m_pPointer );
}
#ifdef _WIN32
AVSINLINE void operator=(const BSTR& value)
{
RELEASEOBJECT(m_pPointer);
if (NULL != value)
m_pPointer = new CString(value);
}
#endif
AVSINLINE void operator=(const CString& value)
{
RELEASEOBJECT(m_pPointer);
......@@ -608,4 +612,4 @@ namespace NSCommon
AVSINLINE CString& get()const { return *m_pPointer; }
};
}
\ No newline at end of file
}
#pragma once
#include "Base.h"
#include "../../../../ServerComponents/DesktopEditor/common/Types.h"
namespace NSCommon
{
......@@ -162,4 +163,4 @@ namespace NSCommon
else if (value > max)
value = max;
}
}
\ No newline at end of file
}
......@@ -2,7 +2,9 @@
#include "math.h"
#include "../Common/Unit.h"
#include "../XML/XmlUtils.h"
#include "../XML/xmlutils.h"
#include "../../../DesktopEditor/common/Types.h"
namespace SimpleTypes
{
......@@ -411,4 +413,4 @@ namespace SimpleTypes
};
} // SimpleTypes
\ No newline at end of file
} // SimpleTypes
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -130,7 +130,7 @@ namespace OOX
{
CString sResult = _T("<a:ahPolar ");
if ( m_oGdRefR.IsInit() )
if ( m_oGdRefR.IsInit() )
{
sResult += _T("gdRefR=\"");
sResult += m_oGdRefR->ToString();
......@@ -1528,4 +1528,4 @@ namespace OOX
} // namespace Logic
} // namespace OOX
#endif // OOX_LOGIC_DRAWING_SHAPE_INCLUDE_H_
\ No newline at end of file
#endif // OOX_LOGIC_DRAWING_SHAPE_INCLUDE_H_
......@@ -3,7 +3,7 @@
#define OOX_RID_INCLUDE_H_
#include "../Base/Base.h"
#include "../XML/XmlUtils.h"
#include "../XML/xmlutils.h"
namespace OOX
{
......@@ -115,4 +115,4 @@ namespace OOX
};
} // namespace OOX
#endif // OOX_RID_INCLUDE_H_
\ No newline at end of file
#endif // OOX_RID_INCLUDE_H_
#pragma once
//#include "NamespaceOwn.h"
#include "../XML/XmlUtils.h"
#include "atlstr.h"
#include "../XML/xmlutils.h"
//#include "atlstr.h"
namespace OOX
{
......@@ -63,11 +63,11 @@ namespace OOX
#define WritingElement_ReadAttributes_Read_if(Reader, AttrName, Value) \
if ( AttrName == wsName )\
Value = Reader.##GetText();
Value = Reader.GetText();
#define WritingElement_ReadAttributes_Read_else_if(Reader, AttrName, Value) \
else if ( AttrName == wsName )\
Value = Reader.##GetText();
Value = Reader.GetText();
#define WritingElement_ReadAttributes_ReadSingle(Reader, AttrName, Value) \
if ( AttrName == wsName )\
......
......@@ -3,16 +3,18 @@
#include "../Base/Base.h"
#include "../Base/SmartPtr.h"
#ifdef _WIN32
#include <atlcoll.h>
#include <atlenc.h>
#endif
#ifndef _USE_NULLABLE_PROPERTY_
using namespace NSCommon;
#endif
namespace XmlUtils
{
static CString strInvalidValue = _T("x(-Jdl%^8sFGs@gkp14jJU(90dyjhjnb*EcfFf%#2124sf98hc");
static _bstr_t g_cpszXML_TextExt = L"./text()";
//static _bstr_t g_cpszXML_TextExt = L"./text()";
// common
AVSINLINE static int GetDigit (TCHAR c)
......@@ -94,6 +96,7 @@ namespace XmlUtils
_stscanf(string, _T("%f"), &f);
return f;
}
#ifdef _WIN32
AVSINLINE static int GetInteger (BSTR string)
{
return _wtoi(string);
......@@ -129,6 +132,7 @@ namespace XmlUtils
*p = 0;
swscanf(string, _T("%d"), *p);
}
#endif
AVSINLINE CString BoolToString (const bool & value)
{
......@@ -209,6 +213,7 @@ namespace XmlUtils
sResult.Replace(_T("\""), _T("&quot;"));
return sResult;
}
/*
class CStringWriter
{
private:
......@@ -234,7 +239,7 @@ namespace XmlUtils
RELEASEMEM(m_pData);
}
__forceinline void AddSize(size_t nSize)
AVSINLINE void AddSize(size_t nSize)
{
if (NULL == m_pData)
{
......@@ -274,7 +279,7 @@ namespace XmlUtils
public:
__forceinline void WriteString(wchar_t* pString, size_t& nLen)
AVSINLINE void WriteString(wchar_t* pString, size_t& nLen)
{
AddSize(nLen);
//memcpy(m_pDataCur, pString, nLen * sizeof(wchar_t));
......@@ -282,12 +287,14 @@ namespace XmlUtils
m_pDataCur += nLen;
m_lSizeCur += nLen;
}
__forceinline void WriteString(_bstr_t& bsString)
#ifdef _WIN32
AVSINLINE void WriteString(_bstr_t& bsString)
{
size_t nLen = bsString.length();
WriteString(bsString.GetBSTR(), nLen);
}
__forceinline void WriteString(const CString& sString)
#endif
AVSINLINE void WriteString(const CString& sString)
{
size_t nLen = (size_t)sString.GetLength();
......@@ -300,13 +307,13 @@ namespace XmlUtils
#endif
}
__forceinline void AddCharSafe(const TCHAR& _c)
AVSINLINE void AddCharSafe(const TCHAR& _c)
{
AddSize(1);
*m_pDataCur++ = _c;
++m_lSizeCur;
}
__forceinline void AddChar2Safe(const TCHAR _c1, const TCHAR& _c2)
AVSINLINE void AddChar2Safe(const TCHAR _c1, const TCHAR& _c2)
{
AddSize(2);
*m_pDataCur++ = _c1;
......@@ -383,12 +390,12 @@ namespace XmlUtils
}
__forceinline size_t GetCurSize()
AVSINLINE size_t GetCurSize()
{
return m_lSizeCur;
}
__forceinline void Write(CStringWriter& oWriter)
AVSINLINE void Write(CStringWriter& oWriter)
{
WriteString(oWriter.m_pData, oWriter.m_lSizeCur);
}
......@@ -443,4 +450,5 @@ namespace XmlUtils
return m_arTableUnicodes[c];
}
};
*/
}
......@@ -2,7 +2,7 @@
#pragma comment(lib, "libxml2.lib")
#include "win_build/Config.h"
//#include "./win_build/config.h"
#include "XML/include/libxml/xmlreader.h"
#include <vector>
......@@ -10,9 +10,11 @@
#include <string>
#include "../../../../../DesktopEditor/common/File.h"
#include "../Utils.h"
namespace XmlUtils
{
class CStringWriter
{
private:
......@@ -42,7 +44,7 @@ namespace XmlUtils
RELEASEMEM(m_pData);
}
__forceinline void AddSize(size_t nSize)
AVSINLINE void AddSize(size_t nSize)
{
if (NULL == m_pData)
{
......@@ -82,25 +84,25 @@ namespace XmlUtils
public:
__forceinline void WriteString(const wchar_t* pString, const size_t& nLen)
AVSINLINE void WriteString(const wchar_t* pString, const size_t& nLen)
{
AddSize(nLen);
memcpy(m_pDataCur, pString, nLen << m_lBinaryFactor);
m_pDataCur += nLen;
m_lSizeCur += nLen;
}
__forceinline void WriteString(const std::wstring& bsString)
AVSINLINE void WriteString(const std::wstring& bsString)
{
WriteString(bsString.c_str(), (size_t)bsString.length());
}
__forceinline void AddCharSafe(const TCHAR& _c)
AVSINLINE void AddCharSafe(const TCHAR& _c)
{
AddSize(1);
*m_pDataCur++ = _c;
++m_lSizeCur;
}
__forceinline void AddChar2Safe(const TCHAR _c1, const TCHAR& _c2)
AVSINLINE void AddChar2Safe(const TCHAR _c1, const TCHAR& _c2)
{
AddSize(2);
*m_pDataCur++ = _c1;
......@@ -181,12 +183,12 @@ namespace XmlUtils
}
}
__forceinline size_t GetCurSize()
AVSINLINE size_t GetCurSize()
{
return m_lSizeCur;
}
__forceinline void Write(CStringWriter& oWriter)
AVSINLINE void Write(CStringWriter& oWriter)
{
WriteString(oWriter.m_pData, oWriter.m_lSizeCur);
}
......@@ -242,6 +244,7 @@ namespace XmlUtils
}
};
typedef
enum XmlNodeType
{
......@@ -902,4 +905,4 @@ namespace XmlUtils
};
}
#endif
\ No newline at end of file
#endif
#pragma once
#include "Utils.h"
#ifdef _WIN32
#import <msxml3.dll> rename_namespace("XML")
......@@ -9,7 +11,7 @@
#include "XmlLite.h"
#endif
#include "Utils.h"
namespace MSXML
{
......@@ -2687,6 +2689,9 @@ namespace XmlUtils
}
}
#endif // #ifdef _WIN32
#include "../Base/Base.h"
class CWCharWrapper
{
public:
......@@ -2699,13 +2704,13 @@ public:
{
}
__forceinline const CWCharWrapper operator=(const wchar_t* cwsOther)
AVSINLINE const CWCharWrapper operator=(const wchar_t* cwsOther)
{
m_cwsString = cwsOther;
return *this;
}
__forceinline const bool operator==(const wchar_t* cwsOther)
AVSINLINE const bool operator==(const wchar_t* cwsOther)
{
if ( 0 == WStrCmp( m_cwsString, cwsOther ) )
return true;
......@@ -2713,7 +2718,7 @@ public:
return false;
}
__forceinline const bool operator!=(const wchar_t* cwsOther)
AVSINLINE const bool operator!=(const wchar_t* cwsOther)
{
if ( 0 != WStrCmp( m_cwsString, cwsOther ) )
return true;
......@@ -2721,7 +2726,7 @@ public:
return false;
}
__forceinline const wchar_t operator[](const int nIndex) const
AVSINLINE const wchar_t operator[](const int nIndex) const
{
int nLen = GetLength();
......@@ -2730,13 +2735,13 @@ public:
return m_cwsString[nIndex];
}
__forceinline const bool IsNull() const
AVSINLINE const bool IsNull() const
{
return (m_cwsString == NULL);
}
__forceinline const int GetLength() const
AVSINLINE const int GetLength() const
{
if ( NULL == m_cwsString )
return 0;
......@@ -2744,7 +2749,7 @@ public:
return (const int)wcslen( m_cwsString );
}
public:
static __forceinline int WStrCmp(const wchar_t* cwsStr1, const wchar_t* cwsStr2)
static AVSINLINE int WStrCmp(const wchar_t* cwsStr1, const wchar_t* cwsStr2)
{
if ( NULL == cwsStr1 && NULL == cwsStr2 )
return 0;
......@@ -2759,7 +2764,7 @@ public:
const wchar_t* m_cwsString;
};
__forceinline const bool operator==(const wchar_t* cwsStr1, const CWCharWrapper& cwsStr2)
AVSINLINE const bool operator==(const wchar_t* cwsStr1, const CWCharWrapper& cwsStr2)
{
if ( 0 == CWCharWrapper::WStrCmp( cwsStr2.m_cwsString, cwsStr1 ) )
return true;
......@@ -2767,7 +2772,7 @@ __forceinline const bool operator==(const wchar_t* cwsStr1, const CWCharWrapper&
return false;
}
__forceinline const bool operator!=(const wchar_t* cwsStr1, const CWCharWrapper& cwsStr2)
AVSINLINE const bool operator!=(const wchar_t* cwsStr1, const CWCharWrapper& cwsStr2)
{
if ( 0 != CWCharWrapper::WStrCmp( cwsStr2.m_cwsString, cwsStr1 ) )
return true;
......@@ -2775,7 +2780,7 @@ __forceinline const bool operator!=(const wchar_t* cwsStr1, const CWCharWrapper&
return false;
}
#endif // #ifdef _WIN32
//#define _USE_LIBXML2_READER_
......
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