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