Commit f15d849e authored by Alexey.Musinov's avatar Alexey.Musinov Committed by Alexander Trofimov

(1.0.0.123) upвыпиливание boost'a



git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@52999 954022d7-b5bf-4e40-9824-e11837661b57
parent 29ca0486
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
#include "..\..\Common\OfficeFileTemplate.h" #include "..\..\Common\OfficeFileTemplate.h"
#include "..\DocxDocConverter\FileConverter.h" #include "..\DocxDocConverter\FileConverter.h"
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
#endif
// IOfficeDocFile // IOfficeDocFile
[ [
object, object,
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
/> />
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\Common\ASCDocxFormat\Source\Utility;..\..\Common\ASCDocxFormat\Source\DocxFormat;..\..\Common\ASCDocxFormat\Source\Common;..\..\Common\ASCDocxFormat\Source\XML;&quot;..\ZLIB\zlib-1.2.3\contrib\minizip&quot;;&quot;..\ZLIB\zlib-1.2.3&quot;;..\..\ASCImageStudio3\ASCGraphics\OfficeSvmFile" AdditionalIncludeDirectories="..\..\Common\ASCDocxFormat\Source\Utility;..\..\Common\ASCDocxFormat\Source\DocxFormat;..\..\Common\ASCDocxFormat\Source\Common;..\..\Common\ASCDocxFormat\Source\XML;&quot;..\ZLIB\zlib-1.2.3\contrib\minizip&quot;;&quot;..\ZLIB\zlib-1.2.3&quot;"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES" PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
RuntimeLibrary="2" RuntimeLibrary="2"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
// ATL // ATL
#include <atlbase.h> #include <atlbase.h>
#include <atlcom.h> #include <atlcom.h>
#include <atlwin.h> #include <atlwin.h>
...@@ -46,6 +47,8 @@ ...@@ -46,6 +47,8 @@
#include <atlconv.h> #include <atlconv.h>
#include <ole2.h> #include <ole2.h>
using namespace ATL;
// C // C
#include <io.h> #include <io.h>
...@@ -58,6 +61,9 @@ ...@@ -58,6 +61,9 @@
#include <share.h> #include <share.h>
#include <iosfwd> #include <iosfwd>
#include <sstream> #include <sstream>
#include <stdarg.h>
#include <wchar.h>
#include <time.h>
// STL // STL
...@@ -68,8 +74,7 @@ ...@@ -68,8 +74,7 @@
#include <algorithm> #include <algorithm>
#include <bitset> #include <bitset>
#include <set> #include <set>
#include <stdexcept>
using namespace ATL;
#include "..\Common\TargetOptions.h" #include "..\Common\TargetOptions.h"
#include "..\Common\FormatUtils.h" #include "..\Common\FormatUtils.h"
...@@ -97,4 +102,9 @@ struct ProgressCallback ...@@ -97,4 +102,9 @@ struct ProgressCallback
LPVOID caller; LPVOID caller;
}; };
#pragma comment(lib, "Utility.lib")
#pragma comment(lib, "Common.lib")
#pragma comment(lib, "DocxFormat.lib")
#pragma comment(lib, "XML.lib")
#include "Resource.h" #include "Resource.h"
\ No newline at end of file
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//0 //0
//0 //0
//122 //123
#define INTVER 1,0,0,122 #define INTVER 1,0,0,123
#define STRVER "1,0,0,122\0" #define STRVER "1,0,0,123\0"
...@@ -33,7 +33,7 @@ namespace ASCDocFormatUtils ...@@ -33,7 +33,7 @@ namespace ASCDocFormatUtils
{ {
template <typename T> void operator()( const T* ptr ) const template <typename T> void operator()( const T* ptr ) const
{ {
RELEASEOBJECT( ptr ); RELEASEOBJECT(ptr);
} }
}; };
...@@ -75,8 +75,6 @@ namespace ASCDocFormatUtils ...@@ -75,8 +75,6 @@ namespace ASCDocFormatUtils
return ( ( value & mask ) == mask ); return ( ( value & mask ) == mask );
} }
/*========================================================================================================*/
static inline int BytesToInt32( const unsigned char *b, unsigned int start, unsigned int length ) static inline int BytesToInt32( const unsigned char *b, unsigned int start, unsigned int length )
{ {
if ( ( b == NULL ) || ( ( start + 3 ) >= length ) ) if ( ( b == NULL ) || ( ( start + 3 ) >= length ) )
...@@ -90,7 +88,6 @@ namespace ASCDocFormatUtils ...@@ -90,7 +88,6 @@ namespace ASCDocFormatUtils
BYTE b2 = b[start+2]; BYTE b2 = b[start+2];
BYTE b3 = b[start+3]; BYTE b3 = b[start+3];
long intValue = ((b3 << 24) | (b2 << 16) | (b1 << 8) | b0); long intValue = ((b3 << 24) | (b2 << 16) | (b1 << 8) | b0);
//int b0 = (int)b[start]; //int b0 = (int)b[start];
...@@ -104,8 +101,6 @@ namespace ASCDocFormatUtils ...@@ -104,8 +101,6 @@ namespace ASCDocFormatUtils
} }
} }
/*========================================================================================================*/
static inline unsigned int BytesToUInt32( const unsigned char *b, unsigned int start, unsigned int length ) static inline unsigned int BytesToUInt32( const unsigned char *b, unsigned int start, unsigned int length )
{ {
if ( ( b == NULL ) || ( ( start + 3 ) >= length ) ) if ( ( b == NULL ) || ( ( start + 3 ) >= length ) )
...@@ -125,8 +120,6 @@ namespace ASCDocFormatUtils ...@@ -125,8 +120,6 @@ namespace ASCDocFormatUtils
} }
} }
/*========================================================================================================*/
static inline short BytesToInt16( const unsigned char *b, unsigned int start, unsigned int length ) static inline short BytesToInt16( const unsigned char *b, unsigned int start, unsigned int length )
{ {
if ( ( b == NULL ) || ( ( start + 1 ) >= length ) ) if ( ( b == NULL ) || ( ( start + 1 ) >= length ) )
...@@ -144,8 +137,6 @@ namespace ASCDocFormatUtils ...@@ -144,8 +137,6 @@ namespace ASCDocFormatUtils
} }
} }
/*========================================================================================================*/
static inline unsigned short BytesToUInt16( const unsigned char *b, unsigned int start, unsigned int length ) static inline unsigned short BytesToUInt16( const unsigned char *b, unsigned int start, unsigned int length )
{ {
if ( ( b == NULL ) || ( ( start + 1 ) >= length ) ) if ( ( b == NULL ) || ( ( start + 1 ) >= length ) )
...@@ -176,35 +167,11 @@ namespace ASCDocFormatUtils ...@@ -176,35 +167,11 @@ namespace ASCDocFormatUtils
return pBuffer [start]; return pBuffer [start];
} }
/*========================================================================================================*/
/*static list<wchar_t>* ToUnicodeChars( const list<byte> *chars )
{
list<byte>::const_iterator iter = chars->begin();
list<wchar_t> *unicodeChars = new list<wchar_t>();
byte bytes[2] = { 0, 0 };
while( iter != chars->end() )
{
bytes[0] = *iter++;
bytes[1] = *iter++;
unicodeChars->push_back( FormatUtils::BytesToUInt16( bytes, 0, 2 ) );
}
return unicodeChars;
}*/
/*========================================================================================================*/
static inline bool IsControlSymbol( unsigned short c ) static inline bool IsControlSymbol( unsigned short c )
{ {
return ( c <= 31 ) ? ( true ) : ( false ); return ( c <= 31 ) ? ( true ) : ( false );
} }
/*========================================================================================================*/
static inline wstring GetXMLSymbol( const WCHAR c ) static inline wstring GetXMLSymbol( const WCHAR c )
{ {
wstring result; wstring result;
...@@ -252,8 +219,6 @@ namespace ASCDocFormatUtils ...@@ -252,8 +219,6 @@ namespace ASCDocFormatUtils
return result; return result;
} }
/*========================================================================================================*/
static inline WCHAR MapByteToWChar( byte byteSymbol ) static inline WCHAR MapByteToWChar( byte byteSymbol )
{ {
WCHAR wcharSymbol = 0; WCHAR wcharSymbol = 0;
...@@ -414,8 +379,6 @@ namespace ASCDocFormatUtils ...@@ -414,8 +379,6 @@ namespace ASCDocFormatUtils
return wcharSymbol; return wcharSymbol;
} }
/*========================================================================================================*/
template<class T> static bool GetSTLCollectionFromBytes( T *STLCollection, byte *bytes, int size, Encoding encoding ) template<class T> static bool GetSTLCollectionFromBytes( T *STLCollection, byte *bytes, int size, Encoding encoding )
{ {
if ( ( STLCollection == NULL ) || ( bytes == NULL ) ) if ( ( STLCollection == NULL ) || ( bytes == NULL ) )
...@@ -453,8 +416,6 @@ namespace ASCDocFormatUtils ...@@ -453,8 +416,6 @@ namespace ASCDocFormatUtils
return false; return false;
} }
/*========================================================================================================*/
static int BitmaskToInt( int value, int mask ) static int BitmaskToInt( int value, int mask )
{ {
int ret = value & mask; int ret = value & mask;
...@@ -477,8 +438,6 @@ namespace ASCDocFormatUtils ...@@ -477,8 +438,6 @@ namespace ASCDocFormatUtils
return ret; return ret;
} }
/*========================================================================================================*/
static inline int GetIntFromBits( int value, unsigned int startBit, unsigned int bitsCount ) static inline int GetIntFromBits( int value, unsigned int startBit, unsigned int bitsCount )
{ {
int retval = value >> startBit; // Move to start bit. int retval = value >> startBit; // Move to start bit.
...@@ -488,8 +447,6 @@ namespace ASCDocFormatUtils ...@@ -488,8 +447,6 @@ namespace ASCDocFormatUtils
return ( retval & bitmask ); // Get value. return ( retval & bitmask ); // Get value.
} }
/*========================================================================================================*/
static inline bool GetBitFromInt( int value, unsigned int bit ) static inline bool GetBitFromInt( int value, unsigned int bit )
{ {
if ( bit >= ( sizeof(int) * 8 ) ) if ( bit >= ( sizeof(int) * 8 ) )
...@@ -500,8 +457,6 @@ namespace ASCDocFormatUtils ...@@ -500,8 +457,6 @@ namespace ASCDocFormatUtils
return ( ( value >> bit ) & 0x00000001 ); return ( ( value >> bit ) & 0x00000001 );
} }
/*========================================================================================================*/
static inline unsigned int GetUIntFromBytesBits( byte* bytes, unsigned int size, unsigned int startBit, unsigned int bitsCount ) static inline unsigned int GetUIntFromBytesBits( byte* bytes, unsigned int size, unsigned int startBit, unsigned int bitsCount )
{ {
if ( ( bytes == NULL ) || ( startBit >= ( size * 8 ) ) || ( bitsCount > ( ( size * 8 ) - startBit ) ) ) if ( ( bytes == NULL ) || ( startBit >= ( size * 8 ) ) || ( bitsCount > ( ( size * 8 ) - startBit ) ) )
...@@ -530,8 +485,6 @@ namespace ASCDocFormatUtils ...@@ -530,8 +485,6 @@ namespace ASCDocFormatUtils
return result; return result;
} }
/*========================================================================================================*/
static inline bool GetBitFromBytes( byte* bytes, unsigned int size, unsigned int bit ) static inline bool GetBitFromBytes( byte* bytes, unsigned int size, unsigned int bit )
{ {
if ( ( bytes == NULL ) || ( bit >= ( size * 8 ) ) ) if ( ( bytes == NULL ) || ( bit >= ( size * 8 ) ) )
...@@ -542,8 +495,6 @@ namespace ASCDocFormatUtils ...@@ -542,8 +495,6 @@ namespace ASCDocFormatUtils
return (bool)GetBitFromInt( bytes[bit/8], bit%8 ); return (bool)GetBitFromInt( bytes[bit/8], bit%8 );
} }
/*========================================================================================================*/
static int ArraySum( byte* values, int size ) static int ArraySum( byte* values, int size )
{ {
int ret = 0; int ret = 0;
...@@ -559,8 +510,6 @@ namespace ASCDocFormatUtils ...@@ -559,8 +510,6 @@ namespace ASCDocFormatUtils
return ret; return ret;
} }
/*========================================================================================================*/
static inline byte* GetBytes( int value ) static inline byte* GetBytes( int value )
{ {
byte *bytes = new byte[4]; byte *bytes = new byte[4];
...@@ -630,8 +579,6 @@ namespace ASCDocFormatUtils ...@@ -630,8 +579,6 @@ namespace ASCDocFormatUtils
} }
} }
/*========================================================================================================*/
static inline wstring IntToFormattedWideString( int value, const WCHAR* format ) static inline wstring IntToFormattedWideString( int value, const WCHAR* format )
{ {
const int size = 33; const int size = 33;
...@@ -646,8 +593,6 @@ namespace ASCDocFormatUtils ...@@ -646,8 +593,6 @@ namespace ASCDocFormatUtils
return wstring( strValue ); return wstring( strValue );
} }
/*========================================================================================================*/
static inline wstring DoubleToFormattedWideString( double value, WCHAR* format ) static inline wstring DoubleToFormattedWideString( double value, WCHAR* format )
{ {
wstring wstr; wstring wstr;
...@@ -671,8 +616,6 @@ namespace ASCDocFormatUtils ...@@ -671,8 +616,6 @@ namespace ASCDocFormatUtils
return wstr; return wstr;
} }
/*========================================================================================================*/
static inline void SetBytes( byte *bytes, int value ) static inline void SetBytes( byte *bytes, int value )
{ {
if ( bytes != NULL ) if ( bytes != NULL )
...@@ -684,8 +627,6 @@ namespace ASCDocFormatUtils ...@@ -684,8 +627,6 @@ namespace ASCDocFormatUtils
} }
} }
/*========================================================================================================*/
static inline void SetBytes( byte *bytes, short value ) static inline void SetBytes( byte *bytes, short value )
{ {
if ( bytes != NULL ) if ( bytes != NULL )
...@@ -695,8 +636,6 @@ namespace ASCDocFormatUtils ...@@ -695,8 +636,6 @@ namespace ASCDocFormatUtils
} }
} }
/*========================================================================================================*/
static inline void SetBytes( byte *bytes, unsigned int value ) static inline void SetBytes( byte *bytes, unsigned int value )
{ {
if ( bytes != NULL ) if ( bytes != NULL )
...@@ -708,8 +647,6 @@ namespace ASCDocFormatUtils ...@@ -708,8 +647,6 @@ namespace ASCDocFormatUtils
} }
} }
/*========================================================================================================*/
static inline void SetBytes( byte *bytes, unsigned short value ) static inline void SetBytes( byte *bytes, unsigned short value )
{ {
if ( bytes != NULL ) if ( bytes != NULL )
...@@ -719,8 +656,6 @@ namespace ASCDocFormatUtils ...@@ -719,8 +656,6 @@ namespace ASCDocFormatUtils
} }
} }
/*========================================================================================================*/
static wstring UTF8Decode( const string& text ) static wstring UTF8Decode( const string& text )
{ {
wstring wstrText( text.size(), 0 ); wstring wstrText( text.size(), 0 );
...@@ -733,6 +668,7 @@ namespace ASCDocFormatUtils ...@@ -733,6 +668,7 @@ namespace ASCDocFormatUtils
struct Rectangle struct Rectangle
{ {
public:
Rectangle() Rectangle()
{ {
topLeftAngle.x = 0; topLeftAngle.x = 0;
...@@ -741,7 +677,6 @@ namespace ASCDocFormatUtils ...@@ -741,7 +677,6 @@ namespace ASCDocFormatUtils
size.cx = 0; size.cx = 0;
size.cy = 0; size.cy = 0;
} }
Rectangle(const POINT& oTopLeftAngle, const SIZE& oSize) Rectangle(const POINT& oTopLeftAngle, const SIZE& oSize)
{ {
topLeftAngle.x = oTopLeftAngle.x; topLeftAngle.x = oTopLeftAngle.x;
...@@ -751,6 +686,7 @@ namespace ASCDocFormatUtils ...@@ -751,6 +686,7 @@ namespace ASCDocFormatUtils
size.cy = oSize.cy; size.cy = oSize.cy;
} }
public:
POINT topLeftAngle; POINT topLeftAngle;
SIZE size; SIZE size;
}; };
...@@ -782,7 +718,7 @@ namespace ASCDocFormatUtils ...@@ -782,7 +718,7 @@ namespace ASCDocFormatUtils
} }
} }
template<class T> inline void SetBits(T bits, unsigned int startBit, unsigned int countOfBits = ( 8 * sizeof(T) )) template<class T> inline void SetBits(T bits, unsigned int startBit, unsigned int countOfBits = (8 * sizeof(T)))
{ {
if ( ( this->bytes != NULL ) && ( startBit < ( 8 * this->size ) ) ) if ( ( this->bytes != NULL ) && ( startBit < ( 8 * this->size ) ) )
{ {
...@@ -814,7 +750,6 @@ namespace ASCDocFormatUtils ...@@ -814,7 +750,6 @@ namespace ASCDocFormatUtils
} }
private: private:
unsigned int size; unsigned int size;
byte* bytes; byte* bytes;
}; };
......
...@@ -9,11 +9,6 @@ ...@@ -9,11 +9,6 @@
#include "InternalElements.h" #include "InternalElements.h"
#include "TableUtils.h" #include "TableUtils.h"
#pragma comment(lib, "Utility.lib")
#pragma comment(lib, "Common.lib")
#pragma comment(lib, "DocxFormat.lib")
#pragma comment(lib, "XML.lib")
namespace DOCXTODOC namespace DOCXTODOC
{ {
class CPrCopier class CPrCopier
......
...@@ -23,11 +23,13 @@ ...@@ -23,11 +23,13 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
......
...@@ -2,4 +2,7 @@ ...@@ -2,4 +2,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging> <EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<EnableUnmanagedDebugging>true</EnableUnmanagedDebugging>
</PropertyGroup>
</Project> </Project>
\ No newline at end of file
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories=".\..\Source\Utility;.\..\Source\XML;.\..\Source\Common;..\..\..\..\..\Redist;..\..\..\..\AVSImageStudio3\AVSGraphics\OfficeSvmFile\" AdditionalIncludeDirectories=".\..\Source\Utility;.\..\Source\XML;.\..\Source\Common;..\..\..\..\..\Redist"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories=".\..\Source\Utility;.\..\Source\XML;.\..\Source\Common;..\..\..\..\..\Redist;..\..\..\..\AVSImageStudio3\AVSGraphics\OfficeSvmFile\" AdditionalIncludeDirectories=".\..\Source\Utility;.\..\Source\XML;.\..\Source\Common;..\..\..\..\..\Redist"
RuntimeLibrary="2" RuntimeLibrary="2"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
......
...@@ -349,6 +349,10 @@ ...@@ -349,6 +349,10 @@
RelativePath="..\Source\Utility\ASCStlUtils.h" RelativePath="..\Source\Utility\ASCStlUtils.h"
> >
</File> </File>
<File
RelativePath="..\Source\Utility\CallTraits.h"
>
</File>
<File <File
RelativePath="..\Source\Utility\codecvt.cpp" RelativePath="..\Source\Utility\codecvt.cpp"
> >
...@@ -461,30 +465,6 @@ ...@@ -461,30 +465,6 @@
RelativePath="..\Source\Utility\Log.h" RelativePath="..\Source\Utility\Log.h"
> >
</File> </File>
<File
RelativePath="..\Source\Utility\LogDetails.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Utility\"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
ObjectFile="$(IntDir)\Utility\"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\Source\Utility\LogDetails.h"
>
</File>
<File <File
RelativePath="..\Source\Utility\nullable.h" RelativePath="..\Source\Utility\nullable.h"
> >
......
...@@ -5,35 +5,29 @@ ...@@ -5,35 +5,29 @@
#include "Path.h" #include "Path.h"
namespace OOX namespace OOX
{ {
namespace Theme namespace Theme
{ {
Path::Path() Path::Path()
{ {
} }
Path::~Path() Path::~Path()
{ {
} }
Path::Path(const XML::XNode& node) Path::Path(const XML::XNode& node)
{ {
fromXML(node); fromXML(node);
} }
const Path& Path::operator =(const XML::XNode& node) const Path& Path::operator =(const XML::XNode& node)
{ {
fromXML(node); fromXML(node);
return *this; return *this;
} }
void Path::fromXML(const XML::XNode& node) void Path::fromXML(const XML::XNode& node)
{ {
const XML::XElement element(node); const XML::XElement element(node);
...@@ -43,7 +37,6 @@ namespace OOX ...@@ -43,7 +37,6 @@ namespace OOX
m_fillToRect = element.element("fillToRect"); m_fillToRect = element.element("fillToRect");
} }
const XML::XNode Path::toXML() const const XML::XNode Path::toXML() const
{ {
return XML::XElement(); return XML::XElement();
......
...@@ -26,16 +26,3 @@ ...@@ -26,16 +26,3 @@
#include "../../../../Common/DocxFormat/Source/Base/SmartPtr.h" #include "../../../../Common/DocxFormat/Source/Base/SmartPtr.h"
#include "../../../../Common/DocxFormat/Source/Base/Nullable.h" #include "../../../../Common/DocxFormat/Source/Base/Nullable.h"
#include "../../../../Common/DocxFormat/Source/Xml/XmlUtils.h" #include "../../../../Common/DocxFormat/Source/Xml/XmlUtils.h"
///////////////////////////////////////////////
#include "Utility.h"
#include "Log.h"
#include "XML.h"
#include "property.h"
#include "nullable.h"
#include "ToString.h"
#include "nullable_property.h"
#include "setter.h"
#include "getter.h"
#include "Common.h"
#pragma once
#ifndef CALL_TRAITS_INCLUDE_H_
#define CALL_TRAITS_INCLUDE_H_
template <typename T>
struct NSCT_IMP
{
typedef const T& param_type;
};
template <typename T>
struct NSCallTraits
{
public:
typedef T value_type;
typedef T& reference;
typedef const T& const_reference;
typedef typename NSCT_IMP<T>::param_type param_type;
};
#endif // CALL_TRAITS_INCLUDE_H_
\ No newline at end of file
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
#define UTILITY_GETTER_INCLUDE_H_ #define UTILITY_GETTER_INCLUDE_H_
#include <stdexcept> #include <stdexcept>
#include <boost/call_traits.hpp>
#include "CallTraits.h"
namespace getter namespace getter
{ {
...@@ -11,15 +12,14 @@ namespace getter ...@@ -11,15 +12,14 @@ namespace getter
class base_getter class base_getter
{ {
protected: protected:
typedef typename boost::call_traits<Type>::param_type Parameter; typedef typename NSCallTraits<Type>::param_type Parameter;
public: public:
const Type operator()(Parameter _value) const const Type operator()(Parameter _value) const
{ {
must_release(); //must_release();
} }
}; };
template<typename Type> template<typename Type>
class simple : private base_getter<Type> class simple : private base_getter<Type>
{ {
...@@ -29,18 +29,6 @@ namespace getter ...@@ -29,18 +29,6 @@ namespace getter
return _value; return _value;
} }
}; };
}
template<typename Type>
class write_only : private base_getter<Type>
{
public:
const Type operator()(Parameter _value) const
{
it_is_write_only();
}
};
} // namespace getter
#endif // UTILITY_GETTER_INCLUDE_H_ #endif // UTILITY_GETTER_INCLUDE_H_
\ No newline at end of file
...@@ -4,56 +4,36 @@ ...@@ -4,56 +4,36 @@
// auto inserted precompiled end // auto inserted precompiled end
#include "Log.h" #include "Log.h"
#include <fstream>
#include <iostream>
Details::Log Log::s_loger("converter.log", "converter.err");
void Log::event(const std::string& message) void Log::event(const std::string& message)
{ {
s_loger.event(message);
} }
void Log::event(const std::wstring& message) void Log::event(const std::wstring& message)
{ {
s_loger.event(message);
} }
void Log::warning(const std::string& message) void Log::warning(const std::string& message)
{ {
s_loger.warning(message);
} }
void Log::warning(const std::wstring& message) void Log::warning(const std::wstring& message)
{ {
s_loger.warning(message);
} }
void Log::error(const std::string& message) void Log::error(const std::string& message)
{ {
s_loger.error(message);
} }
void Log::error(const std::wstring& message) void Log::error(const std::wstring& message)
{ {
s_loger.error(message);
} }
void Log::message(const std::string& message) void Log::message(const std::string& message)
{ {
s_loger.message(message);
} }
void Log::message(const std::wstring& message) void Log::message(const std::wstring& message)
{ {
s_loger.message(message);
} }
\ No newline at end of file
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
#define UTILITY_LOG_INCLUDE_H_ #define UTILITY_LOG_INCLUDE_H_
#include <string> #include <string>
#include "LogDetails.h"
class Log class Log
{ {
...@@ -17,9 +15,6 @@ public: ...@@ -17,9 +15,6 @@ public:
static void warning(const std::wstring& message); static void warning(const std::wstring& message);
static void error(const std::string& message); static void error(const std::string& message);
static void error(const std::wstring& message); static void error(const std::wstring& message);
private:
static Details::Log s_loger;
}; };
#endif // UTILITY_LOG_INCLUDE_H_ #endif // UTILITY_LOG_INCLUDE_H_
\ No newline at end of file
...@@ -3,27 +3,25 @@ ...@@ -3,27 +3,25 @@
#define UTILITY_SETTER_INCLUDE_H_ #define UTILITY_SETTER_INCLUDE_H_
#include <stdexcept> #include <stdexcept>
#include <boost/call_traits.hpp>
#include <algorithm> #include <algorithm>
#include <set> #include <set>
#include "CallTraits.h"
namespace setter namespace setter
{ {
template<typename Type> class base_setter
template<typename Type>
class base_setter
{ {
protected: protected:
typedef typename boost::call_traits<Type>::param_type Parameter; typedef typename NSCallTraits<Type>::param_type Parameter;
public: public:
void operator()(Type& _value, Parameter value) void operator()(Type& _value, Parameter value)
{ {
must_release(); // must_release();
} }
}; };
class none class none
{ {
public: public:
...@@ -33,7 +31,6 @@ namespace setter ...@@ -33,7 +31,6 @@ namespace setter
} }
}; };
template<typename Type> template<typename Type>
class simple : private base_setter<Type> class simple : private base_setter<Type>
{ {
...@@ -44,18 +41,16 @@ namespace setter ...@@ -44,18 +41,16 @@ namespace setter
} }
}; };
class read_only class read_only
{ {
public: public:
template<typename T, typename E> template<typename T, typename E>
void operator()(T, E) void operator()(T, E)
{ {
it_is_read_only(); //it_is_read_only();
} }
}; };
template<typename Type> template<typename Type>
class only_positive : private base_setter<Type> class only_positive : private base_setter<Type>
{ {
......
...@@ -2,20 +2,20 @@ ...@@ -2,20 +2,20 @@
#ifndef UTILITY_NULLABLE_PROPERTY_INCLUDE_H_ #ifndef UTILITY_NULLABLE_PROPERTY_INCLUDE_H_
#define UTILITY_NULLABLE_PROPERTY_INCLUDE_H_ #define UTILITY_NULLABLE_PROPERTY_INCLUDE_H_
#include <string>
#include "Setter.h" #include "Setter.h"
#include "Getter.h" #include "Getter.h"
#include "nullable.h" #include "nullable.h"
#include <boost/call_traits.hpp>
#include <boost/type_traits.hpp>
#include <string>
#include "ToString.h" #include "ToString.h"
#include "CallTraits.h"
template<typename Type, class Setter = setter::simple<Type>, class Getter = getter::simple<Type> > template<typename Type, class Setter = setter::simple<Type>, class Getter = getter::simple<Type> >
class nullable_property class nullable_property
{ {
private: private:
typedef typename boost::call_traits<Type>::param_type Parameter; typedef typename NSCallTraits<Type>::param_type Parameter;
public: public:
nullable_property() {} nullable_property() {}
...@@ -27,41 +27,40 @@ public: ...@@ -27,41 +27,40 @@ public:
: _value(rhs, setter, getter) {} : _value(rhs, setter, getter) {}
nullable_property(const nullable__<Type>& value) : _value(value) {} nullable_property(const nullable__<Type>& value) : _value(value) {}
template<typename U> const nullable_property& operator =(const U& value)
template<typename U>
const nullable_property& operator =(const U& value)
{ {
return ::nullable_property_setter(*this, value); return ::nullable_property_setter(*this, value);
} }
const nullable_property& operator =(const nullable_property& value) const nullable_property& operator =(const nullable_property& value)
{ {
return ::nullable_property_setter(*this, value); return ::nullable_property_setter(*this, value);
} }
template<typename U> template<typename U> const nullable_property& nullable_property_setter(const U& value)
const nullable_property& nullable_property_setter(const U& value)
{ {
_value = static_cast<Type>(value); _value = static_cast<Type>(value);
return *this; return *this;
} }
const nullable_property& nullable_property_setter(const nullable_property& value) const nullable_property& nullable_property_setter(const nullable_property& value)
{ {
_value = value; _value = value;
return *this; return *this;
} }
template<typename U, class S, class G>
const nullable_property& nullable_property_setter(const nullable_property<U, S, G>& value) template<typename U, class S, class G> const nullable_property& nullable_property_setter(const nullable_property<U, S, G>& value)
{ {
_value = value; _value = value;
return *this; return *this;
} }
const nullable_property& nullable_property_setter(const nullable__<Type>& value) const nullable_property& nullable_property_setter(const nullable__<Type>& value)
{ {
_value = value; _value = value;
return *this; return *this;
} }
operator const Type() const {return get();} operator const Type() const {return get();}
operator const nullable__<Type>() const {return _value.get_nullable();} operator const nullable__<Type>() const {return _value.get_nullable();}
const Type get() const {return _value.get();} const Type get() const {return _value.get();}
...@@ -104,16 +103,15 @@ public: ...@@ -104,16 +103,15 @@ public:
private: private:
template<typename Type, class Setter, class Getter, bool simple> template<typename Type, class Setter, class Getter, bool simple>
class _nullable_property class InternalNullableProperty
{ {
private: private:
typedef typename boost::call_traits<Type>::param_type Parameter; typedef typename NSCallTraits<Type>::param_type Parameter;
public: public:
_nullable_property() {} InternalNullableProperty() {}
_nullable_property(Parameter value, const Setter&, const Getter&) InternalNullableProperty(Parameter value, const Setter&, const Getter&) : _value(value) { Setter()(*_value, value); }
: _value(value) {Setter()(*_value, value);} InternalNullableProperty(const nullable__<Type>& value)
_nullable_property(const nullable__<Type>& value)
{ {
if (value.is_init()) if (value.is_init())
{ {
...@@ -122,12 +120,12 @@ private: ...@@ -122,12 +120,12 @@ private:
} }
} }
inline void operator =(Parameter value)
void operator =(Parameter value)
{ {
_value = value; _value = value;
Setter()(*_value, value); Setter()(*_value, value);
} }
template<typename U, class S, class G> template<typename U, class S, class G>
void operator =(const nullable_property<U, S, G>& rhs) void operator =(const nullable_property<U, S, G>& rhs)
{ {
...@@ -141,7 +139,8 @@ private: ...@@ -141,7 +139,8 @@ private:
_value = nullable__<Type>(); _value = nullable__<Type>();
} }
} }
void operator =(const nullable__<Type>& value)
inline void operator =(const nullable__<Type>& value)
{ {
if (value.is_init()) if (value.is_init())
{ {
...@@ -154,37 +153,36 @@ private: ...@@ -154,37 +153,36 @@ private:
} }
} }
inline const Type get() const {return Getter()(*_value);}
inline const nullable__<Type> get_nullable() const {return is_init() ? nullable__<Type>(get()) : nullable__<Type>();}
inline Type const* const get_ptr() const {return _value.get_ptr();}
inline Type* get_ptr() {return _value.get_ptr();}
const Type get() const {return Getter()(*_value);} inline Type& operator*() {return *_value;}
const nullable__<Type> get_nullable() const {return is_init() ? nullable__<Type>(get()) : nullable__<Type>();}
Type const* const get_ptr() const {return _value.get_ptr();}
Type* get_ptr() {return _value.get_ptr();}
Type& operator*() {return *_value;} inline const bool is_init() const {return _value.is_init();}
inline void reset() {_value.reset();}
const bool is_init() const {return _value.is_init();} inline void init() {_value.init();}
void reset() {_value.reset();}
void init() {_value.init();}
private: private:
nullable__<Type> _value; nullable__<Type> _value;
}; };
template<typename Type, class Setter, class Getter> template<typename Type, class Setter, class Getter>
class _nullable_property<Type, Setter, Getter, false> class InternalNullableProperty<Type, Setter, Getter, false>
{ {
private: private:
typedef typename boost::call_traits<Type>::param_type Parameter; typedef typename NSCallTraits<Type>::param_type Parameter;
public: public:
_nullable_property() {} InternalNullableProperty() {}
_nullable_property(const Setter& setter, const Getter& getter) InternalNullableProperty(const Setter& setter, const Getter& getter)
: :
_setter(setter), _setter(setter),
_getter(getter) _getter(getter)
{ {
} }
_nullable_property(Parameter value, const Setter& setter, const Getter& getter) InternalNullableProperty(Parameter value, const Setter& setter, const Getter& getter)
: :
_value(value), _value(value),
_setter(setter), _setter(setter),
...@@ -193,7 +191,7 @@ private: ...@@ -193,7 +191,7 @@ private:
_setter(*_value, value); _setter(*_value, value);
} }
template<typename U, class S, class G> template<typename U, class S, class G>
_nullable_property(nullable_property<U, S, G> const& rhs, const Setter& setter, const Getter& getter) InternalNullableProperty(nullable_property<U, S, G> const& rhs, const Setter& setter, const Getter& getter)
: :
_setter(setter), _setter(setter),
_getter(getter) _getter(getter)
...@@ -204,7 +202,8 @@ private: ...@@ -204,7 +202,8 @@ private:
_setter(*_value, rhs.get()); _setter(*_value, rhs.get());
} }
} }
_nullable_property(const nullable__<Type>& value)
InternalNullableProperty(const nullable__<Type>& value)
{ {
if (value.is_init()) if (value.is_init())
{ {
...@@ -213,12 +212,12 @@ private: ...@@ -213,12 +212,12 @@ private:
} }
} }
inline void operator =(Parameter value)
void operator =(Parameter value)
{ {
_value = value; _value = value;
_setter(*_value, value); _setter(*_value, value);
} }
template<typename U, class S, class G> template<typename U, class S, class G>
void operator =(const nullable_property<U, S, G>& rhs) void operator =(const nullable_property<U, S, G>& rhs)
{ {
...@@ -232,7 +231,8 @@ private: ...@@ -232,7 +231,8 @@ private:
_value = nullable__<Type>(); _value = nullable__<Type>();
} }
} }
void operator =(const nullable__<Type>& value)
inline void operator =(const nullable__<Type>& value)
{ {
if (value.is_init()) if (value.is_init())
{ {
...@@ -245,17 +245,16 @@ private: ...@@ -245,17 +245,16 @@ private:
} }
} }
inline const Type get() const {return _getter(*_value);}
inline const nullable__<Type> get_nullable() const {return is_init() ? nullable__<Type>(get()) : nullable__<Type>();}
inline Type const* const get_ptr() const {return _value.get_ptr();}
inline Type* get_ptr() {return _value.get_ptr();}
const Type get() const {return _getter(*_value);} inline Type& operator*() {return *_value;}
const nullable__<Type> get_nullable() const {return is_init() ? nullable__<Type>(get()) : nullable__<Type>();}
Type const* const get_ptr() const {return _value.get_ptr();}
Type* get_ptr() {return _value.get_ptr();}
Type& operator*() {return *_value;} inline const bool is_init() const {return _value.is_init();}
inline void reset() {_value.reset();}
const bool is_init() const {return _value.is_init();} inline void init() {_value.init();}
void reset() {_value.reset();}
void init() {_value.init();}
private: private:
nullable__<Type> _value; nullable__<Type> _value;
...@@ -264,11 +263,9 @@ private: ...@@ -264,11 +263,9 @@ private:
}; };
private: private:
_nullable_property<Type, Setter, Getter,
boost::has_trivial_constructor<Setter>::value &&
boost::has_trivial_constructor<Getter>::value> _value;
};
InternalNullableProperty<Type, Setter, Getter, true> _value;
};
template<class T, class S, class G> const bool operator ==(const T x, nullable_property<T, S, G> const& y) {return y == x;} template<class T, class S, class G> const bool operator ==(const T x, nullable_property<T, S, G> const& y) {return y == x;}
template<class T, class S, class G> const bool operator !=(const T x, nullable_property<T, S, G> const& y) {return y != x;} template<class T, class S, class G> const bool operator !=(const T x, nullable_property<T, S, G> const& y) {return y != x;}
...@@ -284,14 +281,12 @@ template<typename V, class T, class S, class G> const bool operator > (const V x ...@@ -284,14 +281,12 @@ template<typename V, class T, class S, class G> const bool operator > (const V x
template<typename V, class T, class S, class G> const bool operator <=(const V x, nullable_property<T, S, G> const& y) {return y <= x;} template<typename V, class T, class S, class G> const bool operator <=(const V x, nullable_property<T, S, G> const& y) {return y <= x;}
template<typename V, class T, class S, class G> const bool operator >=(const V x, nullable_property<T, S, G> const& y) {return y >= x;} template<typename V, class T, class S, class G> const bool operator >=(const V x, nullable_property<T, S, G> const& y) {return y >= x;}
template<typename T, class S, class G, typename U> template<typename T, class S, class G, typename U>
const nullable_property<T, S, G>& nullable_property_setter(nullable_property<T, S, G>& lhs, const U& rhs) const nullable_property<T, S, G>& nullable_property_setter(nullable_property<T, S, G>& lhs, const U& rhs)
{ {
return lhs.nullable_property_setter(rhs); return lhs.nullable_property_setter(rhs);
} }
template<typename T, typename U, class S, class G> template<typename T, typename U, class S, class G>
const nullable__<T>& nullable_setter(nullable__<T>& lhs, const nullable_property<U, S, G>& rhs) const nullable__<T>& nullable_setter(nullable__<T>& lhs, const nullable_property<U, S, G>& rhs)
{ {
...@@ -301,15 +296,12 @@ const nullable__<T>& nullable_setter(nullable__<T>& lhs, const nullable_property ...@@ -301,15 +296,12 @@ const nullable__<T>& nullable_setter(nullable__<T>& lhs, const nullable_property
return lhs; return lhs;
} }
template<typename T, class S, class G> template<typename T, class S, class G>
const std::string ToString(const nullable_property<T, S, G>& value) const std::string ToString(const nullable_property<T, S, G>& value)
{ {
return value.ToString(); return value.ToString();
} }
template<typename T, class S, class G> template<typename T, class S, class G>
const nullable_property<T, S, G> merge(const nullable_property<T, S, G>& prev, const nullable_property<T, S, G>& current) const nullable_property<T, S, G> merge(const nullable_property<T, S, G>& prev, const nullable_property<T, S, G>& current)
{ {
......
...@@ -4,31 +4,25 @@ ...@@ -4,31 +4,25 @@
#include "Setter.h" #include "Setter.h"
#include "Getter.h" #include "Getter.h"
#include <boost/call_traits.hpp>
#include <boost/type_traits.hpp>
#include <string> #include <string>
#include "ToString.h" #include "ToString.h"
#include "CallTraits.h"
template<typename Type, class Setter = setter::simple<Type>, class Getter = getter::simple<Type> > template<typename Type, class Setter = setter::simple<Type>, class Getter = getter::simple<Type> >
class property class property
{ {
private: private:
typedef typename boost::call_traits<Type>::param_type Parameter; typedef typename NSCallTraits<Type>::param_type Parameter;
public: public:
property() : _value() {} property() : _value() {}
property(const Setter& setter, const Getter& getter = Getter()) : _value(setter, getter) {} property(const Setter& setter, const Getter& getter = Getter()) : _value(setter, getter) {}
property(Parameter value, const Setter& setter = Setter(), const Getter& getter = Getter()) property(Parameter value, const Setter& setter = Setter(), const Getter& getter = Getter()) : _value(value, setter, getter) {}
: _value(value, setter, getter) {}
template<typename U, class S, class G> template<typename U, class S, class G>
property(property<U, S, G> const& rhs, const Setter& setter = Setter(), const Getter& getter = Getter()) property(property<U, S, G> const& rhs, const Setter& setter = Setter(), const Getter& getter = Getter()) : _value(rhs, setter, getter) {}
: _value(rhs, setter, getter) {}
template<typename U> template<typename U> const property& operator =(const U& value)
const property& operator =(const U& value)
{ {
return ::property_setter(*this, value); return ::property_setter(*this, value);
} }
...@@ -37,9 +31,7 @@ public: ...@@ -37,9 +31,7 @@ public:
return ::property_setter(*this, value); return ::property_setter(*this, value);
} }
template<typename U> const property& property_setter(const U& value)
template<typename U>
const property& property_setter(const U& value)
{ {
_value = static_cast<Type>(value); _value = static_cast<Type>(value);
return *this; return *this;
...@@ -49,8 +41,7 @@ public: ...@@ -49,8 +41,7 @@ public:
_value = value; _value = value;
return *this; return *this;
} }
template<typename U, class S, class G> template<typename U, class S, class G> const property& operator =(const property<U, S, G>& value)
const property& operator =(const property<U, S, G>& value)
{ {
_value = value; _value = value;
return *this; return *this;
...@@ -67,7 +58,6 @@ public: ...@@ -67,7 +58,6 @@ public:
Type const* const operator->() const {return _value.get_ptr();} Type const* const operator->() const {return _value.get_ptr();}
Type* operator->() {return _value.get_ptr();} Type* operator->() {return _value.get_ptr();}
const std::string ToString() const {return ::ToString(get());} const std::string ToString() const {return ::ToString(get());}
const bool operator ==(property<Type, Setter, Getter> const& rhs) const {return get() == rhs.get();} const bool operator ==(property<Type, Setter, Getter> const& rhs) const {return get() == rhs.get();}
...@@ -106,37 +96,32 @@ public: ...@@ -106,37 +96,32 @@ public:
template<typename T, class S, class G> const Type operator *(const property<T, S, G>& rhs) const {return _value * rhs.get();} template<typename T, class S, class G> const Type operator *(const property<T, S, G>& rhs) const {return _value * rhs.get();}
template<typename T, class S, class G> const Type operator /(const property<T, S, G>& rhs) const {return _value / rhs.get();} template<typename T, class S, class G> const Type operator /(const property<T, S, G>& rhs) const {return _value / rhs.get();}
private: private:
template<typename Type, class Setter, class Getter, bool simple> template<typename Type, class Setter, class Getter, bool simple>
class _property class InternalProperty
{ {
private: private:
typedef typename boost::call_traits<Type>::param_type Parameter; typedef typename NSCallTraits<Type>::param_type Parameter;
public: public:
_property() {Setter()(_value, Type());} InternalProperty() {Setter()(_value, Type());}
_property(Parameter value, const Setter&, const Getter&) InternalProperty(Parameter value, const Setter&, const Getter&) : _value(value)
: _value(value)
{ {
Setter()(_value, value); Setter()(_value, value);
} }
template<typename U, class S, class G> template<typename U, class S, class G>
_property(property<U, S, G> const& rhs, const Setter&, const Getter&) InternalProperty(property<U, S, G> const& rhs, const Setter&, const Getter&) : _value(rhs.get())
: _value(rhs.get())
{ {
Setter()(_value, rhs.get()); Setter()(_value, rhs.get());
} }
void operator =(Parameter value) {Setter()(_value, value);} void operator =(Parameter value) {Setter()(_value, value);}
const Type get() const {return Getter()(_value);} const Type get() const {return Getter()(_value);}
Type& get() {return _value;} Type& get() {return _value;}
Type const* const get_ptr() const {return &_value;} Type const* const get_ptr() const {return &_value;}
Type* get_ptr() {return &_value;} Type* get_ptr() {return &_value;}
...@@ -154,46 +139,33 @@ private: ...@@ -154,46 +139,33 @@ private:
Type _value; Type _value;
}; };
template<typename Type, class Setter, class Getter> template<typename Type, class Setter, class Getter>
class _property<Type, Setter, Getter, false> class InternalProperty<Type, Setter, Getter, false>
{ {
private: private:
typedef typename boost::call_traits<Type>::param_type Parameter; typedef typename NSCallTraits<Type>::param_type Parameter;
public: public:
_property() {_setter(_value, Type());} InternalProperty() {_setter(_value, Type());}
_property(const Setter& setter, const Getter& getter) InternalProperty(const Setter& setter, const Getter& getter) : _setter(setter), _getter(getter)
:
_setter(setter),
_getter(getter)
{ {
_setter(_value, Type()); _setter(_value, Type());
} }
_property(Parameter value, const Setter& setter, const Getter& getter) InternalProperty(Parameter value, const Setter& setter, const Getter& getter) : _value(value), _setter(setter), _getter(getter)
:
_value(value),
_setter(setter),
_getter(getter)
{ {
_setter(_value, value); _setter(_value, value);
} }
template<typename U, class S, class G> template<typename U, class S, class G>
_property(property<U, S, G> const& rhs, const Setter& setter, const Getter& getter) InternalProperty(property<U, S, G> const& rhs, const Setter& setter, const Getter& getter) : _value(rhs.get()), _setter(setter), _getter(getter)
:
_value(rhs.get()),
_setter(setter),
_getter(getter)
{ {
_setter(_value, rhs.get()); _setter(_value, rhs.get());
} }
inline void operator =(Parameter value) {_setter(_value, value);}
void operator =(Parameter value) {_setter(_value, value);} inline void operator =(const InternalProperty& rhs)
void operator =(const _property& rhs)
{ {
if(this != &rhs) if(this != &rhs)
{ {
...@@ -201,12 +173,12 @@ private: ...@@ -201,12 +173,12 @@ private:
} }
return *this; return *this;
} }
template<typename U, class S, class G> void operator =(const property<U, S, G> & rhs) template<typename U, class S, class G> void operator =(const property<U, S, G> & rhs)
{ {
_setter(_value, rhs.get()); _setter(_value, rhs.get());
} }
const Type get() const {return _getter(_value);} const Type get() const {return _getter(_value);}
Type& get() {return _value;} Type& get() {return _value;}
...@@ -230,13 +202,9 @@ private: ...@@ -230,13 +202,9 @@ private:
}; };
private: private:
_property<Type, Setter, Getter, InternalProperty<Type, Setter, Getter, true> _value;
boost::has_trivial_constructor<Setter>::value &&
boost::has_trivial_constructor<Getter>::value> _value;
}; };
template<class T, class S, class G> const bool operator ==(const T x, property<T, S, G> const& y) {return y == x;} template<class T, class S, class G> const bool operator ==(const T x, property<T, S, G> const& y) {return y == x;}
template<class T, class S, class G> const bool operator !=(const T x, property<T, S, G> const& y) {return y != x;} template<class T, class S, class G> const bool operator !=(const T x, property<T, S, G> const& y) {return y != x;}
template<class T, class S, class G> const bool operator < (const T x, property<T, S, G> const& y) {return y >= x;} template<class T, class S, class G> const bool operator < (const T x, property<T, S, G> const& y) {return y >= x;}
......
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