diff --git a/OpenFace.sln b/OpenFace.sln
index 1fb61f1..c1be252 100644
--- a/OpenFace.sln
+++ b/OpenFace.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
-VisualStudioVersion = 14.0.25420.1
+VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dlib", "lib\3rdParty\dlib\dlib.vcxproj", "{B47A5F12-2567-44E9-AE49-35763EC82149}"
EndProject
@@ -31,8 +31,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CppInerop", "lib\local\CppI
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UtilLibs", "UtilLibs", "{D5F7B3E2-01FE-4F4A-8CE1-274D74D395D4}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CamCom", "lib\local\CamCom\CamCom.vcxproj", "{0CEC6A75-17BA-4DC5-9405-C74154921E60}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenFaceOffline", "gui\OpenFaceOffline\OpenFaceOffline.csproj", "{A4760F41-2B1F-4144-B7B2-62785AFFE79B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenFaceDemo", "gui\OpenFaceDemo\OpenFaceDemo.csproj", "{E143A2AA-312E-4DFE-B61D-9A87CCBC8E90}"
@@ -131,14 +129,6 @@ Global
{78196985-EE54-411F-822B-5A23EDF80642}.Release|Win32.Build.0 = Release|Win32
{78196985-EE54-411F-822B-5A23EDF80642}.Release|x64.ActiveCfg = Release|x64
{78196985-EE54-411F-822B-5A23EDF80642}.Release|x64.Build.0 = Release|x64
- {0CEC6A75-17BA-4DC5-9405-C74154921E60}.Debug|Win32.ActiveCfg = Debug|Win32
- {0CEC6A75-17BA-4DC5-9405-C74154921E60}.Debug|Win32.Build.0 = Debug|Win32
- {0CEC6A75-17BA-4DC5-9405-C74154921E60}.Debug|x64.ActiveCfg = Debug|x64
- {0CEC6A75-17BA-4DC5-9405-C74154921E60}.Debug|x64.Build.0 = Debug|x64
- {0CEC6A75-17BA-4DC5-9405-C74154921E60}.Release|Win32.ActiveCfg = Release|Win32
- {0CEC6A75-17BA-4DC5-9405-C74154921E60}.Release|Win32.Build.0 = Release|Win32
- {0CEC6A75-17BA-4DC5-9405-C74154921E60}.Release|x64.ActiveCfg = Release|x64
- {0CEC6A75-17BA-4DC5-9405-C74154921E60}.Release|x64.Build.0 = Release|x64
{A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Debug|Win32.ActiveCfg = Debug|x86
{A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Debug|Win32.Build.0 = Debug|x86
{A4760F41-2B1F-4144-B7B2-62785AFFE79B}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -193,7 +183,6 @@ Global
{34032CF2-1B99-4A25-9050-E9C13DD4CD0A} = {9961DDAC-BE6E-4A6E-8EEF-FFC7D67BD631}
{DDC3535E-526C-44EC-9DF4-739E2D3A323B} = {9961DDAC-BE6E-4A6E-8EEF-FFC7D67BD631}
{78196985-EE54-411F-822B-5A23EDF80642} = {D5F7B3E2-01FE-4F4A-8CE1-274D74D395D4}
- {0CEC6A75-17BA-4DC5-9405-C74154921E60} = {D5F7B3E2-01FE-4F4A-8CE1-274D74D395D4}
{A4760F41-2B1F-4144-B7B2-62785AFFE79B} = {C9D8D0B0-11EC-41CB-8524-2DDB5BE94297}
{E143A2AA-312E-4DFE-B61D-9A87CCBC8E90} = {C9D8D0B0-11EC-41CB-8524-2DDB5BE94297}
{F396362D-821E-4EA6-9BBF-1F6050844118} = {C9D8D0B0-11EC-41CB-8524-2DDB5BE94297}
diff --git a/gui/HeadPose-live/MainWindow.xaml.cs b/gui/HeadPose-live/MainWindow.xaml.cs
index e4c1d93..4632f50 100644
--- a/gui/HeadPose-live/MainWindow.xaml.cs
+++ b/gui/HeadPose-live/MainWindow.xaml.cs
@@ -46,7 +46,6 @@ using System.Windows.Media.Imaging;
using OpenCVWrappers;
using CppInterop;
using CppInterop.LandmarkDetector;
-using CameraInterop;
using System.Windows.Threading;
using GazeAnalyser_Interop;
diff --git a/lib/local/CamCom/CamCom.props b/lib/local/CamCom/CamCom.props
deleted file mode 100644
index 9e4a266..0000000
--- a/lib/local/CamCom/CamCom.props
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
- $(SolutionDir)lib\local\CamCom;%(AdditionalIncludeDirectories)
-
-
- dxva2.lib;evr.lib;mf.lib;mfplat.lib;mfplay.lib;mfreadwrite.lib;mfuuid.lib;Strmiids.lib;%(AdditionalDependencies)
-
-
-
-
\ No newline at end of file
diff --git a/lib/local/CamCom/CamCom.vcxproj b/lib/local/CamCom/CamCom.vcxproj
deleted file mode 100644
index 5866b40..0000000
--- a/lib/local/CamCom/CamCom.vcxproj
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
- Debug
- x64
-
-
- Release
- x64
-
-
-
- {0CEC6A75-17BA-4DC5-9405-C74154921E60}
- Win32Proj
- CamCom
- 8.1
-
-
-
- StaticLibrary
- true
- v140
- Unicode
-
-
- StaticLibrary
- false
- v140
- true
- Unicode
-
-
- StaticLibrary
- true
- v140
- Unicode
-
-
- StaticLibrary
- false
- v140
- true
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
- true
-
-
- false
-
-
- false
-
-
-
-
-
- Level3
- Disabled
- WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ./;%(AdditionalIncludeDirectories)
-
-
- Console
- true
-
-
-
-
-
-
- Level3
- Disabled
- _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ./;%(AdditionalIncludeDirectories)
-
-
- Console
- true
-
-
-
-
- Level3
-
-
- MaxSpeed
- true
- true
- WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ./;%(AdditionalIncludeDirectories)
-
-
- Console
- true
- true
- true
-
-
-
-
- Level3
-
-
- MaxSpeed
- true
- true
- NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
- ./;%(AdditionalIncludeDirectories)
-
-
- Console
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/lib/local/CamCom/CamCom.vcxproj.filters b/lib/local/CamCom/CamCom.vcxproj.filters
deleted file mode 100644
index 06e1b61..0000000
--- a/lib/local/CamCom/CamCom.vcxproj.filters
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hh;hpp;hxx;hm;inl;inc;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/lib/local/CamCom/camera_helper.cpp b/lib/local/CamCom/camera_helper.cpp
deleted file mode 100644
index 0b060ad..0000000
--- a/lib/local/CamCom/camera_helper.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-#include "stdafx.h"
-
-#include "camera_helper.h"
-
-//#include
-
-namespace {
- namespace internal {
- template struct property_traits {};
-
- template
- struct camera_control_property_traits
- {
- typedef IAMCameraControl Interface;
- static long id() { return Id; }
- };
-
- template
- struct video_proc_amp_property_traits
- {
- typedef IAMVideoProcAmp Interface;
- static long id() { return Id; }
- };
-
- template<> struct property_traits < camera::Exposure > : public camera_control_property_traits {};
- template<> struct property_traits < camera::Focus > : public camera_control_property_traits{};
- template<> struct property_traits < camera::Zoom > : public camera_control_property_traits{};
- template<> struct property_traits < camera::Pan > : public camera_control_property_traits{};
- template<> struct property_traits < camera::Tilt > : public camera_control_property_traits{};
- template<> struct property_traits < camera::Roll > : public camera_control_property_traits{};
- template<> struct property_traits < camera::Iris > : public camera_control_property_traits{};
-
- template<> struct property_traits < camera::Brightness > : public video_proc_amp_property_traits{};
- template<> struct property_traits < camera::Contrast > : public video_proc_amp_property_traits{};
- template<> struct property_traits < camera::Hue > : public video_proc_amp_property_traits{};
- template<> struct property_traits < camera::Saturation > : public video_proc_amp_property_traits{};
- template<> struct property_traits < camera::Sharpness > : public video_proc_amp_property_traits{};
- template<> struct property_traits < camera::Gamma > : public video_proc_amp_property_traits{};
- template<> struct property_traits < camera::ColorEnable > : public video_proc_amp_property_traits{};
- template<> struct property_traits < camera::WhiteBalance > : public video_proc_amp_property_traits{};
- template<> struct property_traits < camera::BacklightCompensation > : public video_proc_amp_property_traits{};
- template<> struct property_traits < camera::Gain > : public video_proc_amp_property_traits < VideoProcAmp_Gain > {};
-
- template struct interface_traits {};
- template<> struct interface_traits < IAMCameraControl >
- {
- static long auto_flag() { return CameraControl_Flags_Auto; }
- static long manual_flag() { return CameraControl_Flags_Manual; }
- };
- template<> struct interface_traits
- {
- static long auto_flag() { return VideoProcAmp_Flags_Auto; }
- static long manual_flag() { return VideoProcAmp_Flags_Manual; }
- };
-
- template
- bool has(long id, const SourcePtr& source_ptr) {
- comet::com_ptr pInterface = comet::com_cast(source_ptr);
- if (!pInterface) return false;
- long value, flags;
- HRESULT hr = pInterface->Get(id, &value, &flags);
- return SUCCEEDED(hr);
- }
-
- template
- cam_prop_range get_range(long id, const SourcePtr& source_ptr) {
- comet::com_ptr pInterface = comet::try_cast(source_ptr);
- cam_prop_range range;
- long flags;
- pInterface->GetRange(id, &range.min, &range.max, &range.step, &range.defaultValue, &flags) | comet::raise_exception;
- range.canBeAuto = (flags & interface_traits::auto_flag()) != 0;
- range.canBeManual = (flags & interface_traits::manual_flag()) != 0;
- return range;
- }
-
- template
- cam_prop_value get(long id, const SourcePtr& source_ptr) {
- comet::com_ptr pInterface = comet::try_cast(source_ptr);
- cam_prop_value value;
- long flags;
- pInterface->Get(id, &value.value, &flags) | comet::raise_exception;
- value.isAuto = (flags & interface_traits::auto_flag()) != 0 || (flags & interface_traits::manual_flag()) == 0;
- return value;
- }
-
- template
- void set(long id, const cam_prop_value& value, const SourcePtr& source_ptr) {
- comet::com_ptr pInterface = comet::try_cast(source_ptr);
- long flags = value.isAuto ? interface_traits::auto_flag() : interface_traits::manual_flag();
- pInterface->Set(id, value.value, flags) | comet::raise_exception;
- }
- }
-}
-
-#define MAP_OVER_CAMERA_PROPERTIES(FUNC) \
- FUNC(::camera::Exposure, Exposure) \
- FUNC(::camera::Focus, Focus) \
- FUNC(::camera::Zoom, Zoom) \
- FUNC(::camera::Pan, Pan) \
- FUNC(::camera::Tilt, Tilt) \
- FUNC(::camera::Roll, Roll) \
- FUNC(::camera::Iris, Iris) \
- FUNC(::camera::Brightness, Brightness) \
- FUNC(::camera::Contrast, Contrast) \
- FUNC(::camera::Hue, Hue) \
- FUNC(::camera::Saturation, Saturation) \
- FUNC(::camera::Sharpness, Sharpness) \
- FUNC(::camera::Gamma, Gamma) \
- FUNC(::camera::ColorEnable, Color Enable) \
- FUNC(::camera::WhiteBalance, White Balance) \
- FUNC(::camera::BacklightCompensation, Backlight Compensation) \
- FUNC(::camera::Gain, Gain)
-
-
-bool camera::has(Property property) const
-{
- switch (property) {
-#define CASE(PROP, NAME) case PROP: return ::internal::has<::internal::property_traits::Interface>(::internal::property_traits::id(), source_ptr);
- MAP_OVER_CAMERA_PROPERTIES(CASE)
-#undef CASE
- default:
- return false;
- }
-}
-cam_prop_range camera::get_range(Property property) const
-{
- switch (property) {
-#define CASE(PROP, NAME) case PROP: return ::internal::get_range<::internal::property_traits::Interface>(::internal::property_traits::id(), source_ptr);
- MAP_OVER_CAMERA_PROPERTIES(CASE)
-#undef CASE
- default:
- throw std::runtime_error("No such property: " + std::string(camera::property_name(property)));
- }
-}
-cam_prop_value camera::get(Property property) const
-{
- switch (property) {
-#define CASE(PROP, NAME) case PROP: return ::internal::get<::internal::property_traits::Interface>(::internal::property_traits::id(), source_ptr);
- MAP_OVER_CAMERA_PROPERTIES(CASE)
-#undef CASE
- default:
- throw std::runtime_error("No such property: " + std::string(camera::property_name(property)));
- }
-}
-void camera::set(Property property, const cam_prop_value& value)
-{
- switch (property) {
-#define CASE(PROP, NAME) case PROP: ::internal::set<::internal::property_traits::Interface>(::internal::property_traits::id(), value, source_ptr); break;
- MAP_OVER_CAMERA_PROPERTIES(CASE)
-#undef CASE
- }
-}
-
-std::vector camera::list_properties()
-{
- std::vector properties;
- properties.push_back(Exposure); // CameraControl
- properties.push_back(Focus);
- properties.push_back(Zoom);
- properties.push_back(Pan);
- properties.push_back(Tilt);
- properties.push_back(Roll);
- properties.push_back(Iris);
-
- properties.push_back(Brightness);
- properties.push_back(Contrast);
- properties.push_back(Hue);
- properties.push_back(Saturation);
- properties.push_back(Sharpness);
- properties.push_back(Gamma);
- properties.push_back(ColorEnable);
- properties.push_back(WhiteBalance);
- properties.push_back(BacklightCompensation);
- properties.push_back(Gain);
-
- return properties;
-//#define PROPENTRY(PROP, NAME) PROP,
-// MAP_OVER_CAMERA_PROPERTIES(PROPENTRY)
-//#undef PROPENTRY
-// };
-}
-
-const char* camera::property_name(Property property)
-{
- switch (property) {
-#define CASE(PROP, NAME) case PROP: return #NAME;
- MAP_OVER_CAMERA_PROPERTIES(CASE)
-#undef CASE
- default:
- return "UNKNOWN";
- }
-}
diff --git a/lib/local/CamCom/camera_helper.h b/lib/local/CamCom/camera_helper.h
deleted file mode 100644
index 6874647..0000000
--- a/lib/local/CamCom/camera_helper.h
+++ /dev/null
@@ -1,720 +0,0 @@
-#ifndef camera_helper_h__
-#define camera_helper_h__
-
-#pragma once
-
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-
-#include
-
-#include
-
-#include
-#include
-
-namespace comet {
-
-#define MAKE_COMET_COMTYPE(T, BASE) \
- template<> struct comtype< ::T > \
- { \
- static const IID& uuid() { return IID_ ## T; } \
- typedef ::BASE base; \
- }
-
- MAKE_COMET_COMTYPE(IMF2DBuffer, IUnknown);
- MAKE_COMET_COMTYPE(IAMVideoProcAmp, IUnknown);
- MAKE_COMET_COMTYPE(IAMCameraControl, IUnknown);
-}
-
-struct cam_prop_range
-{
- long min;
- long max;
- long step;
- long defaultValue;
- bool canBeAuto;
- bool canBeManual;
-};
-
-inline std::ostream& operator<<(std::ostream& os, const cam_prop_range& val)
-{
- os << "[" << val.min << ":" << val.step << ":" << val.max << "], " << val.defaultValue;
- if (val.canBeAuto && val.canBeManual)
- os << " (auto/manual)";
- else if (val.canBeAuto)
- os << " (auto)";
- else if (val.canBeManual)
- os << " (manual)";
- return os;
-}
-
-struct cam_prop_value
-{
- long value;
- bool isAuto;
-
- cam_prop_value() : value(0), isAuto(true)
- {
- }
-
- cam_prop_value(long value, bool isAuto = false) : value(value), isAuto(isAuto)
- {
- }
-
- operator long() const
- {
- return value;
- }
-
- static cam_prop_value AUTO(long value = 0) {
- return cam_prop_value(value, true);
- };
- static cam_prop_value MANUAL(long value = 0) {
- return cam_prop_value(value, false);
- };
-};
-
-inline std::ostream& operator<<(std::ostream& os, const cam_prop_value& val)
-{
- os << val.value;
- os << " (";
- if (val.isAuto)
- os << "auto";
- else
- os << "manual";
- os << ")";
- return os;
-}
-
-namespace MediaFormat
-{
- enum e
- {
- Unknown,
- RGB32, // MFVideoFormat_RGB32
- ARGB32, // MFVideoFormat_ARGB32
- RGB24, // MFVideoFormat_RGB24
- RGB555, // MFVideoFormat_RGB555
- RGB565, // MFVideoFormat_RGB565
- RGB8, // MFVideoFormat_RGB8
- AI44, // MFVideoFormat_AI44
- AYUV, // MFVideoFormat_AYUV
- YUY2, // MFVideoFormat_YUY2
- YVYU, // MFVideoFormat_YVYU
- YVU9, // MFVideoFormat_YVU9
- UYVY, // MFVideoFormat_UYVY
- NV11, // MFVideoFormat_NV11
- NV12, // MFVideoFormat_NV12
- YV12, // MFVideoFormat_YV12
- I420, // MFVideoFormat_I420
- IYUV, // MFVideoFormat_IYUV
- Y210, // MFVideoFormat_Y210
- Y216, // MFVideoFormat_Y216
- Y410, // MFVideoFormat_Y410
- Y416, // MFVideoFormat_Y416
- Y41P, // MFVideoFormat_Y41P
- Y41T, // MFVideoFormat_Y41T
- Y42T, // MFVideoFormat_Y42T
- P210, // MFVideoFormat_P210
- P216, // MFVideoFormat_P216
- P010, // MFVideoFormat_P010
- P016, // MFVideoFormat_P016
- v210, // MFVideoFormat_v210
- v216, // MFVideoFormat_v216
- v410, // MFVideoFormat_v410
- MP43, // MFVideoFormat_MP43
- MP4S, // MFVideoFormat_MP4S
- M4S2, // MFVideoFormat_M4S2
- MP4V, // MFVideoFormat_MP4V
- WMV1, // MFVideoFormat_WMV1
- WMV2, // MFVideoFormat_WMV2
- WMV3, // MFVideoFormat_WMV3
- WVC1, // MFVideoFormat_WVC1
- MSS1, // MFVideoFormat_MSS1
- MSS2, // MFVideoFormat_MSS2
- MPG1, // MFVideoFormat_MPG1
- DVSL, // MFVideoFormat_DVSL
- DVSD, // MFVideoFormat_DVSD
- DVHD, // MFVideoFormat_DVHD
- DV25, // MFVideoFormat_DV25
- DV50, // MFVideoFormat_DV50
- DVH1, // MFVideoFormat_DVH1
- DVC, // MFVideoFormat_DVC
- H264, // MFVideoFormat_H264
- MJPG, // MFVideoFormat_MJPG
- YUV_420O, // MFVideoFormat_420O
- H263, // MFVideoFormat_H263
- H264_ES, // MFVideoFormat_H264_ES
- MPEG2, // MFVideoFormat_MPEG2
- };
-
- inline e fromGUID(GUID guid)
- {
- if (guid == MFVideoFormat_RGB32) return RGB32;
- else if (guid == MFVideoFormat_ARGB32) return ARGB32;
- else if (guid == MFVideoFormat_RGB24) return RGB24;
- else if (guid == MFVideoFormat_RGB555) return RGB555;
- else if (guid == MFVideoFormat_RGB565) return RGB565;
- else if (guid == MFVideoFormat_RGB8) return RGB8;
- else if (guid == MFVideoFormat_AI44) return AI44;
- else if (guid == MFVideoFormat_AYUV) return AYUV;
- else if (guid == MFVideoFormat_YUY2) return YUY2;
- else if (guid == MFVideoFormat_YVYU) return YVYU;
- else if (guid == MFVideoFormat_YVU9) return YVU9;
- else if (guid == MFVideoFormat_UYVY) return UYVY;
- else if (guid == MFVideoFormat_NV11) return NV11;
- else if (guid == MFVideoFormat_NV12) return NV12;
- else if (guid == MFVideoFormat_YV12) return YV12;
- else if (guid == MFVideoFormat_I420) return I420;
- else if (guid == MFVideoFormat_IYUV) return IYUV;
- else if (guid == MFVideoFormat_Y210) return Y210;
- else if (guid == MFVideoFormat_Y216) return Y216;
- else if (guid == MFVideoFormat_Y410) return Y410;
- else if (guid == MFVideoFormat_Y416) return Y416;
- else if (guid == MFVideoFormat_Y41P) return Y41P;
- else if (guid == MFVideoFormat_Y41T) return Y41T;
- else if (guid == MFVideoFormat_Y42T) return Y42T;
- else if (guid == MFVideoFormat_P210) return P210;
- else if (guid == MFVideoFormat_P216) return P216;
- else if (guid == MFVideoFormat_P010) return P010;
- else if (guid == MFVideoFormat_P016) return P016;
- else if (guid == MFVideoFormat_v210) return v210;
- else if (guid == MFVideoFormat_v216) return v216;
- else if (guid == MFVideoFormat_v410) return v410;
- else if (guid == MFVideoFormat_MP43) return MP43;
- else if (guid == MFVideoFormat_MP4S) return MP4S;
- else if (guid == MFVideoFormat_M4S2) return M4S2;
- else if (guid == MFVideoFormat_MP4V) return MP4V;
- else if (guid == MFVideoFormat_WMV1) return WMV1;
- else if (guid == MFVideoFormat_WMV2) return WMV2;
- else if (guid == MFVideoFormat_WMV3) return WMV3;
- else if (guid == MFVideoFormat_WVC1) return WVC1;
- else if (guid == MFVideoFormat_MSS1) return MSS1;
- else if (guid == MFVideoFormat_MSS2) return MSS2;
- else if (guid == MFVideoFormat_MPG1) return MPG1;
- else if (guid == MFVideoFormat_DVSL) return DVSL;
- else if (guid == MFVideoFormat_DVSD) return DVSD;
- else if (guid == MFVideoFormat_DVHD) return DVHD;
- else if (guid == MFVideoFormat_DV25) return DV25;
- else if (guid == MFVideoFormat_DV50) return DV50;
- else if (guid == MFVideoFormat_DVH1) return DVH1;
- else if (guid == MFVideoFormat_DVC) return DVC;
- else if (guid == MFVideoFormat_H264) return H264;
- else if (guid == MFVideoFormat_MJPG) return MJPG;
- else if (guid == MFVideoFormat_420O) return YUV_420O;
- else if (guid == MFVideoFormat_H263) return H263;
- else if (guid == MFVideoFormat_H264_ES) return H264_ES;
- else if (guid == MFVideoFormat_MPEG2) return MPEG2;
- else return Unknown;
- }
-
- inline const char* to_string (const MediaFormat::e& format)
- {
- switch (format)
- {
- case RGB32: return "RGB32";
- case ARGB32: return "ARGB32";
- case RGB24: return "RGB24";
- case RGB555: return "RGB555";
- case RGB565: return "RGB565";
- case RGB8: return "RGB8";
- case AI44: return "AI44";
- case AYUV: return "AYUV";
- case YUY2: return "YUY2";
- case YVYU: return "YVYU";
- case YVU9: return "YVU9";
- case UYVY: return "UYVY";
- case NV11: return "NV11";
- case NV12: return "NV12";
- case YV12: return "YV12";
- case I420: return "I420";
- case IYUV: return "IYUV";
- case Y210: return "Y210";
- case Y216: return "Y216";
- case Y410: return "Y410";
- case Y416: return "Y416";
- case Y41P: return "Y41P";
- case Y41T: return "Y41T";
- case Y42T: return "Y42T";
- case P210: return "P210";
- case P216: return "P216";
- case P010: return "P010";
- case P016: return "P016";
- case v210: return "v210";
- case v216: return "v216";
- case v410: return "v410";
- case MP43: return "MP43";
- case MP4S: return "MP4S";
- case M4S2: return "M4S2";
- case MP4V: return "MP4V";
- case WMV1: return "WMV1";
- case WMV2: return "WMV2";
- case WMV3: return "WMV3";
- case WVC1: return "WVC1";
- case MSS1: return "MSS1";
- case MSS2: return "MSS2";
- case MPG1: return "MPG1";
- case DVSL: return "DVSL";
- case DVSD: return "DVSD";
- case DVHD: return "DVHD";
- case DV25: return "DV25";
- case DV50: return "DV50";
- case DVH1: return "DVH1";
- case DVC: return "DVC";
- case H264: return "H264";
- case MJPG: return "MJPG";
- case YUV_420O: return "420O";
- case H263: return "H263";
- case H264_ES: return "H264_ES";
- case MPEG2: return "MPEG2";
- default: return "Unknown";
- }
- }
-
- inline std::ostream& operator<< (std::ostream& os, const MediaFormat::e& format)
- {
- return os << to_string(format);
- }
-}
-
-class media_type
-{
-public:
- media_type() : _ptr(NULL)
- {
- }
-
- media_type(IMFMediaType* ptr) : _ptr(ptr)
- {
- }
-
- media_type(comet::com_ptr ptr) : _ptr(ptr)
- {
- }
-
- cv::Size resolution() const
- {
- UINT32 width, height;
- MFGetAttributeSize(_ptr.in(), MF_MT_FRAME_SIZE, &width, &height) | comet::raise_exception;
- return cv::Size(width, height);
- }
-
- double framerate() const
- {
- UINT32 num, denom;
- MFGetAttributeRatio(_ptr.in(), MF_MT_FRAME_RATE, &num, &denom) | comet::raise_exception;
- return static_cast(num) / denom;
- }
-
- MediaFormat::e format() const
- {
- GUID subtype;
- _ptr->GetGUID(MF_MT_SUBTYPE, &subtype) | comet::raise_exception;
- return MediaFormat::fromGUID(subtype);
- }
-
-#ifdef _TYPEDEF_BOOL_TYPE
- typedef media_type _Myt;
- _TYPEDEF_BOOL_TYPE;
- _OPERATOR_BOOL() const _NOEXCEPT
- { // test for non-null pointer
- return (_ptr != 0 ? _CONVERTIBLE_TO_TRUE : 0);
- }
-#else
- explicit operator bool() const
- { // test for non-null pointer
- return _ptr != 0;
- }
-#endif
-
- comet::com_ptr _ptr;
-};
-
-
-class camera
-{
-public:
- camera()
- {
- }
-
- camera(IMFActivate* ptr) : activate_ptr(ptr)
- {
- }
-
- camera(comet::com_ptr ptr) : activate_ptr(ptr)
- {
- }
-
- // TODO actually implement these or make sure they are deleted/created correctly, this might be the reason for weird mapping of stuff
- camera(const camera& other)
- {
-// this->
-// this = other;
- }
- //= delete;
-
- camera(camera&& other)
- {
- *this = std::move(other);
- }
-
- //camera& operator=(const camera& other) = delete;
-
- camera& operator=(camera&& other)
- {
- activate_ptr.swap(other.activate_ptr);
- source_ptr.swap(other.source_ptr);
- reader_ptr.swap(other.reader_ptr);
- return *this;
- }
-
- ~camera()
- {
- shutdown();
- }
-
- bool is_active() const
- {
- return !source_ptr.is_null();
- }
-
- void activate()
- {
- if (activate_ptr)
- activate_ptr->ActivateObject(IID_IMFMediaSource, reinterpret_cast(source_ptr.out())) | comet::raise_exception;
- reader_ptr = NULL;
- }
-
- void shutdown()
- {
- if (activate_ptr)
- activate_ptr->ShutdownObject() | comet::raise_exception;
- source_ptr = NULL;
- reader_ptr = NULL;
- }
-
- cv::Mat read_frame(int streamIndex = MF_SOURCE_READER_FIRST_VIDEO_STREAM, int bufferIndex = 0)
- {
- if (!activate_ptr)
- return cv::Mat();
-
- if (!reader_ptr)
- {
- comet::com_ptr pAttributes;
- MFCreateAttributes(pAttributes.out(), 1) | comet::raise_exception;
- pAttributes->SetUINT32(MF_SOURCE_READER_ENABLE_VIDEO_PROCESSING, TRUE) | comet::raise_exception;
- pAttributes->SetUINT32(MF_SOURCE_READER_DISCONNECT_MEDIASOURCE_ON_SHUTDOWN, TRUE) | comet::raise_exception;
-
- MFCreateSourceReaderFromMediaSource(source_ptr.in(), pAttributes.in(), reader_ptr.out()) | comet::raise_exception;
- }
-
- comet::com_ptr sample;
- DWORD actualStreamIndex, flags;
- LONGLONG timestamp;
- try
- {
- do
- {
- reader_ptr->ReadSample(
- streamIndex, // Stream index.
- 0, // Flags.
- &actualStreamIndex, // Receives the actual stream index.
- &flags, // Receives status flags.
- ×tamp, // Receives the time stamp.
- sample.out() // Receives the sample or NULL.
- ) | comet::raise_exception;
- } while (sample == NULL && (flags & MF_SOURCE_READERF_STREAMTICK));
- }
- catch (std::exception& e)
- {
- std::cerr << "Error getting frame: " << e.what() << std::endl;
- std::cerr << " flags: " << flags << std::endl;
- shutdown();
- activate();
- throw;
- }
-
- media_type cur_media_type;
- reader_ptr->GetCurrentMediaType(actualStreamIndex, cur_media_type._ptr.out()) | comet::raise_exception;
-
- //PrintAttributes(cur_media_type._ptr.in());
-
- auto format = cur_media_type.format();
-
- cv::Mat ret;
-
- DWORD bufCount;
- sample->GetBufferCount(&bufCount) | comet::raise_exception;
-
- DWORD bufIndex = bufferIndex >= 0 ? bufferIndex : bufCount - bufferIndex;
-
- if (bufCount > bufIndex)
- {
- comet::com_ptr buffer;
- sample->GetBufferByIndex(bufferIndex, buffer.out()) | comet::raise_exception;
-
- switch (format)
- {
- case MediaFormat::RGB24:
- case MediaFormat::ARGB32:
- case MediaFormat::RGB32:
- {
- comet::com_ptr buf2d = try_cast(buffer);
-
- //DWORD length;
- //buf2d->GetContiguousLength(&length) | comet::raise_exception;
-
- //ret.create();
-
- //COMET_ASSERT(ret.dataend - ret.datastart == length);
-
- auto resolution = cur_media_type.resolution();
-
- struct buf2d_lock
- {
- comet::com_ptr& buf2d;
-
- buf2d_lock(comet::com_ptr& buf2d, BYTE*& scanline0, LONG& pitch) : buf2d(buf2d)
- {
- buf2d->Lock2D(&scanline0, &pitch) | comet::raise_exception;
- }
-
- ~buf2d_lock()
- {
- buf2d->Unlock2D() | comet::raise_exception;
- }
- };
-
- BYTE *scanline0;
- LONG pitch;
- buf2d_lock buf_lock_token(buf2d, scanline0, pitch);
- if (pitch >= 0)
- {
- cv::Mat buf2dmat(resolution,
- (format == MediaFormat::RGB24) ? CV_8UC3 : CV_8UC4,
- scanline0,
- pitch);
- buf2dmat.copyTo(ret);
- }
- else
- {
- cv::Mat buf2dmat(resolution,
- (format == MediaFormat::RGB24) ? CV_8UC3 : CV_8UC4,
- scanline0 + pitch*(resolution.height-1),
- -pitch);
- cv::flip(buf2dmat, ret, 0);
- }
-
- break;
- }
- case MediaFormat::MJPG:
- {
- struct buf_lock
- {
- comet::com_ptr& buffer;
-
- buf_lock(comet::com_ptr& buffer, BYTE*& data, DWORD& maxLength, DWORD& length) : buffer(buffer)
- {
- buffer->Lock(&data, &maxLength, &length) | comet::raise_exception;
- }
-
- ~buf_lock()
- {
- buffer->Unlock() | comet::raise_exception;
- }
- };
-
- BYTE* data;
- DWORD length;
- DWORD maxLength;
-
- buf_lock buf_lock_token(buffer, data, maxLength, length);
-
- ret = cv::imdecode(cv::Mat(length, 1, CV_8U, data), cv::IMREAD_COLOR);
-
- break;
- }
- default:
- std::stringstream sstream;
- sstream << "Unknown media format: " << format;
- throw std::runtime_error(sstream.str());
- }
- }
-
- return ret;
- }
-
- std::string name() const
- {
- return get_attr_str(MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME);
- }
-
- std::string symlink() const
- {
- return get_attr_str(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK);
- }
-
- // TODO change
- //explicit operator bool() const
- //{
- // return !activate_ptr.is_null();
- //}
-
- enum Property
- {
- // CameraControl
- Exposure,
- Focus,
- Zoom,
- Pan,
- Tilt,
- Roll,
- Iris,
-
- // VideoProcAmp
- Brightness,
- Contrast,
- Hue,
- Saturation,
- Sharpness,
- Gamma,
- ColorEnable,
- WhiteBalance,
- BacklightCompensation,
- Gain
- };
-
- bool has(Property property) const;
- cam_prop_range get_range(Property property) const;
- cam_prop_value get(Property property) const;
- void set(Property property, const cam_prop_value& value);
-
- static std::vector list_properties();
- static const char* property_name(Property);
-
- std::vector media_types(int streamIndex = 0) const
- {
- auto pHandler = getMediaTypeHandler(streamIndex);
-
- DWORD cTypes = 0;
- pHandler->GetMediaTypeCount(&cTypes) | comet::raise_exception;
-
- std::vector ret;
- for (DWORD i = 0; i < cTypes; i++)
- {
- comet::com_ptr pType;
- pHandler->GetMediaTypeByIndex(i, pType.out()) | comet::raise_exception;
- ret.emplace_back(pType);
- }
-
- return ret;
- }
-
- media_type get_media_type(int streamIndex = 0)
- {
- media_type ret;
- getMediaTypeHandler(streamIndex)->GetCurrentMediaType(ret._ptr.out()) | comet::raise_exception;
- return ret;
- }
-
- void set_media_type(const media_type& type, int streamIndex = 0)
- {
- getMediaTypeHandler(streamIndex)->SetCurrentMediaType(type._ptr.in()) | comet::raise_exception;
- if (reader_ptr)
- {
- reader_ptr->SetCurrentMediaType(streamIndex, nullptr, type._ptr.in()) | comet::raise_exception;
- }
- }
-
- // TODO change
- //explicit operator bool() {
- // return !activate_ptr.is_null();
- //}
-
-private:
- std::string get_attr_str(REFGUID guid) const
- {
- comet::task_ptr pStr;
- UINT32 strLen;
- activate_ptr->GetAllocatedString(guid, pStr.out(), &strLen) | comet::raise_exception;
- return comet::bstr_t(pStr.in(), strLen).s_str();
- }
-
- comet::com_ptr getMediaTypeHandler(int streamIndex = 0) const
- {
- comet::com_ptr pPD;
- source_ptr->CreatePresentationDescriptor(pPD.out()) | comet::raise_exception;
-
- BOOL fSelected;
- comet::com_ptr pSD;
- pPD->GetStreamDescriptorByIndex(streamIndex, &fSelected, pSD.out()) | comet::raise_exception;
-
- comet::com_ptr pHandler;
- pSD->GetMediaTypeHandler(pHandler.out()) | comet::raise_exception;
-
- return pHandler;
- }
-
- comet::com_ptr activate_ptr;
- comet::com_ptr source_ptr;
- comet::com_ptr reader_ptr;
-};
-
-class camera_helper
-{
-public:
- static std::vector get_all_cameras()
- {
- comet::com_ptr config;
- MFCreateAttributes(config.out(), 1) | comet::raise_exception;
-
- config->SetGUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE, MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID) | comet::raise_exception;
-
- comet::com_ptr_array com_ptr_array;
- MFEnumDeviceSources(config.in(), com_ptr_array.out(), com_ptr_array.out_count()) | comet::raise_exception;
-
- std::vector ret;
- for (size_t i = 0; i < com_ptr_array.count(); ++i)
- {
- ret.emplace_back(com_ptr_array[i]);
- }
- return ret;
- }
-
- static camera get_camera_by_symlink(const std::string& symlink)
- {
- // This is how you should do it, but for some reason it gives an activate pointer with no friendly name
-
- // comet::com_ptr config;
- // MFCreateAttributes(config.out(), 1) | comet::raise_exception;
- //
- // config->SetGUID(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE, MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_GUID) | comet::raise_exception;
- // comet::bstr_t symlink_bstr(symlink);
- // config->SetString(MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK, symlink_bstr.c_str()) | comet::raise_exception;
- //
- // comet::com_ptr activate_ptr;
- // MFCreateDeviceSourceActivate(config.in(), activate_ptr.out()) | comet::raise_exception;
- //
- // return camera(activate_ptr);
-
- for(auto&& camera : get_all_cameras())
- {
- if (camera.symlink() == symlink)
- return std::move(camera);
- }
-
- throw std::runtime_error("No camera with symlink: " + std::string(symlink));
- }
-};
-
-#endif // camera_helper_h__
diff --git a/lib/local/CamCom/comet/array.h b/lib/local/CamCom/comet/array.h
deleted file mode 100644
index f305f74..0000000
--- a/lib/local/CamCom/comet/array.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/** \file
-* Array wrapper.
-*/
-/*
-* Copyright © 2001 Sofus Mortensen
-*
-* This material is provided "as is", with absolutely no warranty
-* expressed or implied. Any use is at your own risk. Permission to
-* use or copy this software for any purpose is hereby granted without
-* fee, provided the above notices are retained on all copies.
-* Permission to modify the code and to distribute modified code is
-* granted, provided the above notices are retained, and a notice that
-* the code was modified is included with the above copyright notice.
-*
-* This header is part of Comet version 2.
-* https://github.com/alamaison/comet
-*
-*/
-
-/*
-* comet::array_t is adapted from class array by Nicolai M. Josuttis
-*
-* (C) Copyright Nicolai M. Josuttis 2001.
-* Permission to copy, use, modify, sell and distribute this software
-* is granted provided this copyright notice appears in all copies.
-* This software is provided "as is" without express or implied
-* warranty, and with no claim as to its suitability for any purpose.
-*
-*/
-
-#ifndef COMET_ARRAY_H
-#define COMET_ARRAY_H
-
-#include
-#include
-#include
-#include
-#include
-
-namespace comet {
-
-#pragma pack(push)
-#pragma pack(1)
-
- /*!\addtogroup Misc
- */
- //@{
-
- template class array_t
- {
- T a_[SZ];
- public:
- typedef T value_type;
- typedef typename std::vector::iterator iterator;
- typedef typename std::vector::const_iterator const_iterator;
-
- typedef typename std::vector::reverse_iterator reverse_iterator;
- typedef typename std::vector::const_reverse_iterator const_reverse_iterator;
-
- typedef typename std::vector::size_type size_type;
- typedef typename std::vector::difference_type difference_type;
-
- typedef T& reference;
- typedef const T& const_reference;
-
- // reference operator[](size_type i) { return a_[i]; }
- // const_reference operator[](size_type i) const { return a_[i]; }
-
- iterator begin() { return iterator(a_); }
- iterator end() { return iterator(a_ + SZ); }
- const_iterator begin() const { return const_iterator(a_); }
- const_iterator end() const { return const_iterator(a_ + SZ); }
-
- reverse_iterator rbegin() { return reverse_iterator(a_); }
- reverse_iterator rend() { return reverse_iterator(a_ + SZ); }
- const_reverse_iterator rbegin() const { return const_reverse_iterator(a_); }
- const_reverse_iterator rend() const { return const_reverse_iterator(a_ + SZ); }
-
- operator const T*() const { return a_; }
- operator T*() { return a_; }
-
- static size_type size() { return SZ; }
- static bool empty() { return false; }
- static size_type max_size() { return SZ; }
- enum { static_size = SZ };
-
- reference front() { return a_[0]; }
- const_reference front() const { return a_[0]; }
- reference back() { return a_[SZ-1]; };
- const_reference back() const { return a_[SZ-1]; }
-
- // swap (note: linear complexity)
- void swap (array_t& y) {
- std::swap_ranges(begin(),end(),y.begin());
- }
-
- // assignment with type conversion
- template
- array_t& operator= (const array_t& rhs) {
- std::copy(rhs.begin(),rhs.end(), begin());
- return *this;
- }
-
- // assign one value to all elements
- void assign (const T& value)
- {
- std::fill_n(begin(),size(),value);
- }
-
- reference at(size_type i) { rangecheck(i); return a_[i]; }
- const_reference at(size_type i) const { rangecheck(i); return a_[i]; }
-
- private:
- // check range (may be private because it is static)
- static void rangecheck (size_type i) {
- if (i >= size()) { throw std::range_error("array"); }
- }
-
- };
- //@}
-#pragma pack(pop)
-
- // comparisons
- template
- bool operator== (const array_t& x, const array_t& y) {
- return std::equal(x.begin(), x.end(), y.begin());
- }
- template
- bool operator< (const array_t& x, const array_t& y) {
- return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
- }
- template
- bool operator!= (const array_t& x, const array_t& y) {
- return !(x==y);
- }
- template
- bool operator> (const array_t& x, const array_t& y) {
- return y
- bool operator<= (const array_t& x, const array_t& y) {
- return !(y
- bool operator>= (const array_t& x, const array_t& y) {
- return !(x
-
-# if defined(COMET_ASSERT_THROWS) || defined(COMET_ASSERT_THROWS_ALWAYS)
-# if defined(COMET_ASSERT_THROWS_ALWAYS) || !defined(NDEBUG)
-namespace comet
-{
- /*! \defgroup ErrorHandling Error handling.
- */
- //@{
-//! Indicates a comet assertion failed.
-/** This is enabled for debug builds if COMET_ASSERT_THROWS is defined and
- * enabled for both debug and release if COMET_ASSERT_THROWS_ALWAYS is defined.
- */
-struct assert_failed : std::runtime_error
-{
- assert_failed( const char *val) : runtime_error(val) {}
-};
- //@}
-}
-# define COMET_ASSERT(x_) if (x_) ; else throw comet::assert_failed("Assert Failed: " #x_ );
-# define COMET_THROWS_ASSERT throw( comet::assert_failed)
-# else
-# define COMET_ASSERT(x_) ;
-# endif
-
-# else
-# define COMET_THROWS_ASSERT throw()
-# ifndef __CYGWIN__
-
-# include
-# define COMET_ASSERT _ASSERTE
-
-# else
-
-# include
-# define COMET_ASSERT assert
-# endif
-# endif
-/*! \addtogroup ErrorHandling
- */
-//@{
-/** \def COMET_ASSERT Assertion in commet.
- * \sa COMET_THROWS_ASSERT COMET_ASSERT_THROWS_ALWAYS
- */
- //@}
-
-#endif
diff --git a/lib/local/CamCom/comet/atl_module.h b/lib/local/CamCom/comet/atl_module.h
deleted file mode 100644
index 5c37bdc..0000000
--- a/lib/local/CamCom/comet/atl_module.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/** \file
- * ATL Module Compatability wrapper.
- */
-/*
- * Copyright © 2000, 2001 Paul Hollingsworth, Michael Geddes
- * Copyright © 2013 Alexander Lamaison
- *
- * This material is provided "as is", with absolutely no warranty
- * expressed or implied. Any use is at your own risk. Permission to
- * use or copy this software for any purpose is hereby granted without
- * fee, provided the above notices are retained on all copies.
- * Permission to modify the code and to distribute modified code is
- * granted, provided the above notices are retained, and a notice that
- * the code was modified is included with the above copyright notice.
- *
- * This header is part of Comet version 2.
- * https://github.com/alamaison/comet
- */
-
-#ifndef COMET_ATL_MODULE_H
-#define COMET_ATL_MODULE_H
-
-#include
-
-#include
-
-namespace comet {
- /*! \defgroup ATL ATL conversion.
- */
- //@{
-
- /** \struct declspec_comtype atl_module.h comet/atl_module.h
- * Helper to create a 'comtype' for a non-comet interface.
- * \code
- * namespace comet{
- * template<> struct comtype :
- * declspec_comtype
- * { };
- * };
- * \endcode
- *
- */
- template struct declspec_comtype
- {
- static const uuid_t& uuid() { return uuid_t::create_const_reference(__uuidof(ITF)); }
- typedef BASE base;
- };
-
-
- /// Placeholder for an empty comet typelibrary.
- struct empty_typelib
- {
- typedef nil coclasses;
- };
-
- template
- class atl_module_ex : public ATL_MODULE
- {
- // ATL will take the responsibility of registering the embedded type library.
- public:
- HRESULT Init(_ATL_OBJMAP_ENTRY* p, HINSTANCE h, const GUID* plibid = NULL)
- {
- module().instance(h);
- return ATL_MODULE::Init(p, h, plibid);
- }
-
- HRESULT RegisterServer(BOOL bRegTypeLib = FALSE, const CLSID* pCLSID = NULL)
- {
- HRESULT hr = ATL_MODULE::RegisterServer(bRegTypeLib, pCLSID);
- if(SUCCEEDED(hr))
- hr = COM_SERVER::DllRegisterServer();
- return hr;
- }
-
- HRESULT UnregisterServer(BOOL bUnRegTypeLib, const CLSID* pCLSID = NULL)
- {
- COM_SERVER::DllUnregisterServer();
- return ATL_MODULE::UnregisterServer(bUnRegTypeLib, pCLSID);
- }
-
- HRESULT GetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
- {
- HRESULT hr = COM_SERVER::DllGetClassObject( rclsid, riid, ppv);
- if( hr == CLASS_E_CLASSNOTAVAILABLE )
- {
- hr = ATL_MODULE::GetClassObject(rclsid, riid,ppv);
- }
- return hr;
- }
-
- LONG GetLockCount()
- {
- return module().rc() + ATL_MODULE::GetLockCount();
- }
- };
-
- /** Wraps an ATL::CComModule to provide co-existing ATL/Comet co-classes.
- * ATL will take responsibility for registering the embedded type-library.
- *
- * Here is an example of how to use it:
- * \code
- * struct typelib_subset
- * {
- * typedef COMET_STRICT_TYPENAME comet::typelist::make_list< CoClass1, CoClass2 > coclasses;
- * };
- * comet::atl_module _Module;
- * \endcode
- * And in std.h:
- * \code
- * struct typelib_subset;
- * extern comet::atl_module _Module;
- * \endcode
- */
- template
- class atl_module : public atl_module_ex< com_server >, ATL_MODULE >
- {
- };
- //@}
-} // namespace comet
-
-#endif
diff --git a/lib/local/CamCom/comet/auto_buffer.h b/lib/local/CamCom/comet/auto_buffer.h
deleted file mode 100644
index 0a304bd..0000000
--- a/lib/local/CamCom/comet/auto_buffer.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/** \file
- * Simple uncopyable buffer class.
- */
- /*
- * Copyright © 2004, Michael Geddes, Lijun Qin.
- *
- * This material is provided "as is", with absolutely no warranty
- * expressed or implied. Any use is at your own risk. Permission to
- * use or copy this software for any purpose is hereby granted without
- * fee, provided the above notices are retained on all copies.
- * Permission to modify the code and to distribute modified code is
- * granted, provided the above notices are retained, and a notice that
- * the code was modified is included with the above copyright notice.
- *
- * This header is part of Comet version 2.
- * https://github.com/alamaison/comet
- */
-
-#ifndef INCLUDE_COMET_AUTO_BUFFER_H
-#define INCLUDE_COMET_AUTO_BUFFER_H
-
-#ifdef _SHOW_INC
-#pragma message(" #Include " __FILE__)
-#endif
-
-namespace comet
-{
- /*!\addtogroup Misc
- */
- //@{
-
- /** \class auto_buffer_t auto_buffer.h comet/auto_buffer.h
- * Simle auto-deleting buffer class.
- * Non-copyable /returnable.
- */
- template
- class auto_buffer_t
- {
- public:
- typedef size_t size_type;
- /** Create a buffer of the given size.
- * This is the only valid constructor.
- */
- explicit auto_buffer_t(size_type size)
- {
- begin_ = new T[size];
- }
- /// Auto-delete the buffer.
- ~auto_buffer_t() throw() { delete[] begin_; }
-
- /// Clear the buffer.
- void clear() throw()
- {
- delete[] begin_;
- begin_ = 0;
- }
- /// Is the buffer empty.
- bool empty() const throw()
- {
- return begin_ != NULL;
- }
- /// Resize the buffer.
- void resize( size_type newSize) throw()
- {
- delete[] begin_;
- begin_ = new T[newSize];
- }
-
- /// Return a reference to the specifed element.
- T & at( size_type t) throw() { return begin_[t]; }
- T & operator[]( size_type t) throw() { return begin_[t]; }
- /// Return a const reference to the specifed element.
- const T & at( size_type t) const throw() { return begin_[t]; }
- const T & operator[]( size_type t) const throw() { return begin_[t]; }
-
- /// Detatch the memory.
- T *detach()
- {
- T *val = begin_;
- begin_ = NULL;
- return val;
- }
- /// Return the memory.
- T *get() { return begin_; }
- const T *get()const { return begin_; }
-
- private:
- /// Can't assign.
- auto_buffer_t &operator=(const auto_buffer_t &);
- /// can't copy.
- auto_buffer_t(const auto_buffer_t&);
-
- /// Pointer to memory.
- T *begin_;
- };
- //@}
-}
-
-#endif /* INCLUDE_COMET_AUTO_BUFFER_H */
diff --git a/lib/local/CamCom/comet/bstr.h b/lib/local/CamCom/comet/bstr.h
deleted file mode 100644
index 23fd332..0000000
--- a/lib/local/CamCom/comet/bstr.h
+++ /dev/null
@@ -1,948 +0,0 @@
-/** \file
- * BSTR wrapper classes.
- */
-/*
- * Copyright © 2000-2004 Sofus Mortensen, Michael Geddes
- * Copyright © 2012 Alexander Lamaison
- *
- * This material is provided "as is", with absolutely no warranty
- * expressed or implied. Any use is at your own risk. Permission to
- * use or copy this software for any purpose is hereby granted without
- * fee, provided the above notices are retained on all copies.
- * Permission to modify the code and to distribute modified code is
- * granted, provided the above notices are retained, and a notice that
- * the code was modified is included with the above copyright notice.
- *
- * This header is part of Comet version 2.
- * https://github.com/alamaison/comet
- */
-
-#ifndef COMET_BSTR_H
-#define COMET_BSTR_H
-
-#include
-
-#ifdef COMET_BROKEN_WTYPES
-#include
-#endif // COMET_BROKEN_WTYPES
-#include
-#include
-#include
-#ifndef COMET_GCC_HEADERS
-#include
-#endif // COMET_GCC_HEADERS
-
-#include
-#include
-#undef max
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#pragma warning(push)
-#pragma warning(disable : 4522 4521)
-
-#pragma comment( lib, "oleaut32" )
-
-namespace comet {
-
-#ifndef NORM_IGNOREKASHIDA
-#define NORM_IGNOREKASHIDA 0x00040000
-#endif // NORM_IGNOREKASHIDA
- /*! \addtogroup COMType
- */
- //@{
- //! Comparsion flags.
- /*! Can be used with \link comet::bstr_t::cmp cmp \endlink or the comparsion functors.
- \sa cmp
- less
- less_equal
- greater
- greater_equal
- equal_to
- not_equal_to
- */
-
- enum compare_flags_t
- {
- cf_ignore_case = NORM_IGNORECASE, //!< Ignore case.
- cf_ingore_nonspace = NORM_IGNORENONSPACE, //!< Ignore nonspacing chars.
- cf_ignore_symbols = NORM_IGNORESYMBOLS, //!< Ignore symbols.
- cf_ignore_width = NORM_IGNOREWIDTH, //!< Ignore string width.
- cf_ignore_kanatype = NORM_IGNOREKANATYPE, //!< Ignore Kana type.
- cf_ignore_kashida = NORM_IGNOREKASHIDA //!< Ignore Arabic kashida characters.
- };
- //@}
-
- namespace impl {
-
- inline const wchar_t* null_to_empty(const wchar_t* s)
- { return s ? s : L""; }
-
- } // namespace
-
-
- /*! \addtogroup COMType
- */
- //@{
-
- /*! \class bstr_t bstr.h comet/bstr.h
- * BSTR Wrapper.
- * \sa bstr_t
- */
- class bstr_t {
- public:
- typedef wchar_t value_type;
-#if !(defined(_STLP_DEBUG) || (defined(_HAS_ITERATOR_DEBUGGING)) && _MSC_VER >= 1400)
- typedef std::wstring::iterator iterator;
- typedef std::wstring::const_iterator const_iterator;
-
- typedef std::wstring::reverse_iterator reverse_iterator;
- typedef std::wstring::const_reverse_iterator const_reverse_iterator;
-#else // _STLP_DEBUG
- typedef wchar_t *iterator;
- typedef const wchar_t *const_iterator;
-#if defined(COMET_STD_ITERATOR)
- typedef std::reverse_iterator reverse_iterator;
- typedef std::reverse_iterator const_reverse_iterator;
-#else
- // workaround for broken reverse_iterator implementations due to no partial specialisation
- typedef std::reverse_iterator reverse_iterator;
- typedef std::reverse_iterator const_reverse_iterator;
-#endif
-#endif // _STLP_DEBUG
-
- typedef std::wstring::size_type size_type;
- typedef std::wstring::difference_type difference_type;
-
- typedef wchar_t& reference;
- typedef const wchar_t const_reference;
-
- private:
- BSTR str_;
-
- void construct() { str_ = 0; }
- void construct(BSTR s, bool copy) throw(std::bad_alloc)
- { if (copy) str_ = copy_str(s); else str_ = s; }
-
- void construct(const wchar_t* s) throw(std::bad_alloc)
- { str_ = copy_str(s); }
-
- void construct(const wchar_t* s, size_t len) throw(std::bad_alloc)
- { str_ = copy_str(s, len); }
-
- void construct(const char* s) throw(std::bad_alloc, std::runtime_error) {
- convert_str(s, -1);
- }
-
- void construct(const char* s, size_t len)
- {
- if (len >= static_cast(std::numeric_limits::max()))
- throw std::length_error(
- "String exceeded maximum length for conversion");
-
- convert_str(s, static_cast(len+1));
- }
-
- void construct(const uuid_t& u, bool braces)
- {
- str_ = impl::bad_alloc_check(::SysAllocStringLen(0, braces?38:36));
- u.copy_to_str(str_+(braces?1:0));
- if (braces)
- {
- str_[0]=L'{';
- str_[37]=L'}';
- }
- }
-
- void construct(const wchar_t* s1, size_t l1, const wchar_t* s2, size_t l2) throw(std::bad_alloc)
- {
- str_ = impl::bad_alloc_check(::SysAllocStringLen(NULL, UINT(l1+l2)));
- if (l1) memcpy(str_, s1, sizeof(wchar_t)*(l1));
- if (l2) memcpy(str_+l1, s2, sizeof(wchar_t)*(1+l2));
- }
-
- void destroy() throw()
- { if (str_) ::SysFreeString(str_); }
-
- bool is_regular() const throw()
- { return !str_ || length() == wcslen(str_); }
-
- static BSTR copy_str(const wchar_t* src) throw(std::bad_alloc)
- { return src ? impl::bad_alloc_check(::SysAllocString(src)) : 0; }
-
- static BSTR copy_str(const wchar_t* src, size_t len) throw(std::bad_alloc)
- { return src ? impl::bad_alloc_check(::SysAllocStringLen(src, UINT(len))) : 0; }
-
- static BSTR copy_str(BSTR src) throw(std::bad_alloc)
- { return src ? impl::bad_alloc_check(::SysAllocStringLen(src, ::SysStringLen(src))) : 0; }
-
- void convert_str(const char* s, int l) throw(std::bad_alloc, std::runtime_error)
- {
- if (s != 0) {
-#if defined(_MBCS) || !defined(COMET_NO_MBCS)
- int wl = ::MultiByteToWideChar(CP_ACP, 0, s, l, NULL,0);
-#else
- int wl = ((l>=0)?l: (1+strlen(s)));
- COMET_ASSERT( wl == ::MultiByteToWideChar( CP_ACP, 0, s, l, NULL,0));
-#endif
- str_ = impl::bad_alloc_check(::SysAllocStringLen(0, wl - 1));
- if (::MultiByteToWideChar(CP_ACP, 0, s, l, str_, wl) == 0)
- {
- destroy();
- throw std::runtime_error("MultiByteToWideChar has failed");
- }
- } else str_ = 0;
- }
-
- public:
- /*! Default constructor
- Constructs a null string.
- */
- bstr_t() throw()
- {
- construct();
- }
-
- //! Copy constructor
- /*!
- \param s
- String initialise bstr_t from.
-
- \exception std::bad_alloc
- On memory exhaustion std::bad_alloc is thrown.
- */
- bstr_t(const bstr_t& s) throw(std::bad_alloc)
- {
- construct(s.str_, true);
- }
-
- //! Construct string from const wchar_t*
- /*!
- \param s
- String to initialise bstr_t from.
-
- \exception std::bad_alloc
- On memory exhaustion std::bad_alloc is thrown.
- */
- bstr_t(const wchar_t* s) throw(std::bad_alloc)
- {
- construct(s);
- }
-
- bstr_t(const wchar_t* s, size_t len) throw(std::bad_alloc)
- {
- construct(s, len);
- }
-
- //! Construct string from const char*
- /*!
- \param s
- String to initialise bstr_t from.
-
- \exception std::bad_alloc
- On memory exhaustion std::bad_alloc is thrown.
- \exception std::runtime_error
- Should string conversion fail, std::runtime_error will be thrown.
- */
- bstr_t(const char* s) throw(std::runtime_error)
- {
- construct(s);
- }
-
- bstr_t(const char* s, size_t len) throw(std::bad_alloc)
- {
- construct(s, len);
- }
-
- //! Construct string from const std::string&
- /*!
- \param s
- String to initialise bstr_t from.
-
- \exception std::bad_alloc
- On memory exhaustion std::bad_alloc is thrown.
- \exception std::length_error
- If this given string is too long to be converted,
- std::length_error is thrown.
- \exception std::runtime_error
- Should string conversion fail, std::runtime_error is thrown.
- */
- bstr_t(const std::string& s)
- {
- construct(s.c_str(), s.length());
- }
-
- //! Construct string from BSTR
- /*!
- Takes ownership of specified BSTR. To prevent misuse the BSTR must be wrapped using auto_attach.
-
- \code
- bstr_t bs( auto_attach( myBSTR ) );
- \endcode
-
- \param s
- String to initialise bstr_t from.
- */
- bstr_t(const impl::auto_attach_t& s) throw()
- {
- construct(s.get(), false);
- }
-
-
- //! Construct string from const std::wstring&
- /*!
- \param s
- String to initialise bstr_t from.
-
- \exception std::bad_alloc
- On memory exhaustion std::bad_alloc is thrown.
- */
- bstr_t(const std::wstring& s) throw(std::bad_alloc)
- {
- construct(s.c_str(), s.length());
- }
-
- explicit bstr_t(size_type sz, wchar_t c) throw(std::bad_alloc)
- {
- str_ = impl::bad_alloc_check(::SysAllocStringLen(0, UINT(sz)));
- std::fill(begin(), end(), c);
- }
-
- explicit bstr_t(size_type sz) throw(std::bad_alloc)
- {
- str_ = impl::bad_alloc_check(::SysAllocStringLen(0, UINT(sz)));
- }
-
- template
- explicit bstr_t(IT first, IT last)
- {
- str_ = 0;
- assign(first, last);
- }
-
- explicit bstr_t(const uuid_t& u, bool braces = false)
- {
- construct(u, braces);
- }
-
- private:
- bstr_t(const wchar_t* s1, size_t l1, const wchar_t* s2, size_t l2) throw(std::bad_alloc)
- {
- construct(s1, l1, s2, l2);
- }
-
- public:
- //! Destructor
- /*!
- Deletes the wrapped BSTR.
- */
- ~bstr_t() throw()
- {
- destroy();
- }
-
- //! Swap
- void swap(bstr_t& x) throw()
- {
- std::swap(str_, x.str_);
- }
-
- //! Explicit conversion to const wchar_t*
- const wchar_t* c_str() const throw()
- { return impl::null_to_empty(str_); }
-
- //! Explicit conversion to std::wstring
- std::wstring w_str() const throw()
- { return impl::null_to_empty(str_); }
-
-#ifdef _MBCS
-#ifndef COMET_NO_MBCS_WARNING
-#pragma message( "Warning: _MBCS is defined. bstr_t::s_str may return an std::string containing multibyte characters" )
-#endif
-#endif
-
- //! Explicit conversion to std::string
- std::string s_str() const
- {
- if (is_empty()) return std::string();
-
- if (length() > static_cast(std::numeric_limits::max()))
- throw std::length_error("String is too large to be converted");
-
- int ol = static_cast(length());
-
-#if defined(_MBCS) || !defined(COMET_NO_MBCS)
- // Calculate the required length of the buffer
- int l = WideCharToMultiByte(CP_ACP, 0, str_, ol, NULL, 0, NULL, NULL);
-#else // _MBCS
- int l = ol;
- COMET_ASSERT( l == WideCharToMultiByte(CP_ACP, 0, str_, ol, NULL, 0, NULL, NULL));
-#endif // _MBCS
-
- // Create the buffer
- std::string rv(l, std::string::value_type());
- // Do the conversion.
- if (0 == WideCharToMultiByte(
- CP_ACP, 0, str_, ol, &rv[0], l, NULL, NULL))
- {
- DWORD err = GetLastError();
- raise_exception(HRESULT_FROM_WIN32(err));
- }
-
- return rv;
- }
-
- //! Explicit conversion to "tstring".
-#ifdef _UNICODE
- std::wstring t_str() const
- {
- return w_str();
- }
-#else
- std::string t_str() const
- {
- return s_str();
- }
-#endif
-
- //! Implicit conversion to std::wstring
- operator std::wstring() const { return w_str(); }
-
- //! Implicit conversion to std::string
- operator std::string() const { return s_str(); }
-
- //! Returns true if and only if wrapped str is null
- bool is_null() const throw()
- { return str_ == 0; }
-
- /** Returns true if and only if wrapped str has zero length.
- */
- bool is_empty() const throw() { return length() == 0; }
-
- //! Returns true if and only if wrapped str has zero length.
- bool empty() const throw() { return length() == 0; }
-
- //! Returns length of wrapped string.
- size_t length() const throw()
- { return is_null() ? 0 : ::SysStringLen(str_); }
-
- size_t size() const throw()
- { return length(); }
-
- /*! \internal */
- BSTR get_raw() const
- { return str_; }
-
- friend
- std::basic_ostream &operator<<(std::basic_ostream &os, const bstr_t &val)
- { os << val.s_str(); return os; }
-
- friend
- std::basic_ostream &operator<<(std::basic_ostream &os, const bstr_t &val)
- { os << val.w_str(); return os; }
-
- /// \name Boolean operators
- //@{
-
- bool operator==(const wchar_t* s) const
- { return 0 == wcscmp(c_str(), impl::null_to_empty(s) ) && is_regular(); }
-
- bool operator!=(const wchar_t* s) const
- { return !operator==(s); }
-
- bool operator<(const wchar_t* s) const
- { return wcscmp(c_str(), impl::null_to_empty(s)) < 0 && is_regular(); }
-
- bool operator>(const wchar_t* s) const
- { return wcscmp(c_str(), impl::null_to_empty(s)) > 0 && !is_regular(); }
-
- bool operator>=(const wchar_t* s) const
- { return !operator<(s); }
-
- bool operator<=(const wchar_t* s) const
- { return !operator>(s); }
-
- bool operator==(const std::wstring& s) const
- {
- size_t l = length();
- if (l != s.length()) return false;
- return 0 == memcmp(str_, s.c_str(), sizeof(wchar_t)*l);
- }
-
- bool operator!=(const std::wstring& s) const
- { return !operator==(s); }
-
- bool operator<(const std::wstring& s) const
- { return std::lexicographical_compare(str_, str_+length(), s.begin(), s.end()); }
-
- bool operator>(const std::wstring& s) const
- { return std::lexicographical_compare(str_, str_+length(), s.begin(), s.end(), std::greater()); }
-
- bool operator>=(const std::wstring& s) const
- { return !operator<(s); }
-
- bool operator<=(const std::wstring& s) const
- { return !operator>(s); }
-
- bool operator==(const bstr_t& s) const
- {
- if (str_ == 0 && s.str_ == 0) return true;
- return ::VarBstrCmp(str_, s.str_, ::GetThreadLocale(), 0) == VARCMP_EQ;
- }
-
- bool operator!=(const bstr_t& s) const
- { return !operator==(s); }
-
- bool operator<(const bstr_t& s) const
- {
- if (str_ == 0) {
- return s.str_ != 0;
- }
-
- if (s.str_ == 0) return false;
-
- return ::VarBstrCmp(str_, s.str_, ::GetThreadLocale(), 0) == VARCMP_LT;
- }
-
- bool operator>(const bstr_t& s) const
- {
- if (str_ == 0) {
- return s.str_ != 0;
- }
-
- if (s.str_ == 0) return false;
-
- return ::VarBstrCmp(str_, s.str_, ::GetThreadLocale(), 0) == VARCMP_GT;
- }
-
- bool operator>=(const bstr_t& s) const
- { return !operator<(s); }
-
- bool operator<=(const bstr_t& s) const
- { return !operator>(s); }
- //@}
-
- //! String comparsion function.
- /*! \param s String to compare
- \param flags Comparison Flags
- \retval <0 if less
- \retval 0 if Equal
- \retval >0 if greater
- */
- int cmp(const bstr_t& s, compare_flags_t flags = compare_flags_t(0)) const
- {
- HRESULT res = ::VarBstrCmp(str_, s.str_, ::GetThreadLocale(), flags);
- switch(res)
- {
- case VARCMP_EQ: return 0;
- case VARCMP_GT: return 1;
- case VARCMP_LT: return -1;
- case VARCMP_NULL:
- return ((str_==0)?0:1) - ((s.str_==0)?0:1);
- }
- if (str_==0 || s.str_ ==0)
- return ((str_==0)?0:1) - ((s.str_==0)?0:1);
- raise_exception(res); return 0;
- }
-
- //!\name Comparison Functors
- //@{
- //! Less Functor.
- /*! Useful for STL containers.
- \code
- typedef stl::map < comet::bstr_t, long, bstr_t::less > string_long_map;
- \endcode
- \param CF comparison flags.
- \relates bstr_t
- */
- template
- struct less : std::binary_function< bstr_t,bstr_t,bool>{
- /// Functor.
- bool operator()(const bstr_t& l, const bstr_t& r) const
- { return l.cmp(r, CF) <0; }
- };
-
- //! less or equal functor.
- /*! \relates bstr_t */
- template
- struct less_equal : std::binary_function< bstr_t,bstr_t,bool> {
- /// Functor.
- bool operator()(const bstr_t& l, const bstr_t& r) const
- { return l.cmp(r, CF) <=0; }
- };
-
- //! greater functor.
- /*! \relates bstr_t */
- template
- struct greater : std::binary_function< bstr_t,bstr_t,bool> {
- /// Functor.
- bool operator()(const bstr_t& l, const bstr_t& r) const
- { return l.cmp(r, CF) > 0; }
- };
-
- //! greater or equal functor.
- /*! \relates bstr_t */
- template
- struct greater_equal : std::binary_function< bstr_t,bstr_t,bool> {
- /// Functor.
- bool operator()(const bstr_t& l, const bstr_t& r) const
- { return l.cmp(r, CF) >=0; }
- };
-
- //! equality functor.
- template
- struct equal_to : std::binary_function< bstr_t,bstr_t,bool> {
- bool operator()(const bstr_t& l, const bstr_t& r) const
- { return l.cmp(r, CF) == 0; }
- };
-
- //! Inequality functor.
- /*! \relates bstr_t */
- template
- struct not_equal_to : std::binary_function< bstr_t,bstr_t,bool>{
- /// Functor.
- bool operator()(const bstr_t& l, const bstr_t& r) const
- { return l.cmp(r, CF) != 0; }
- };
- //@}
-
- iterator begin() { return iterator(str_); }
- iterator end() { return iterator(str_ + length()); }
- const_iterator begin() const { return const_iterator(str_); }
- const_iterator end() const { return const_iterator(str_ + length()); }
-
- reverse_iterator rbegin() { return reverse_iterator(str_); }
- reverse_iterator rend() { return reverse_iterator(str_ + length()); }
- const_reverse_iterator rbegin() const { return const_reverse_iterator(str_); }
- const_reverse_iterator rend() const { return const_reverse_iterator(str_ + length()); }
-
- reference at(size_type i) { rangecheck(i); return str_[i]; }
- const_reference at(size_type i) const { rangecheck(i); return str_[i]; }
-
- private:
- // check range (may be private because it is static)
- void rangecheck (size_type i) const {
- if (i >= length()) { throw std::range_error("bstr_t"); }
- }
-
- public:
- const_reference operator[](size_type idx) const
- { return str_[idx]; }
-
- reference operator[](size_type idx)
- { return str_[idx]; }
-
- //! Assign string to be \p sz of character \p c .
- void assign(size_type sz, wchar_t c) throw(std::bad_alloc)
- {
- bstr_t t(sz, c);
- swap(t);
- }
-
- //! Assign string from two iterators.
- template
- void assign(IT first, IT last)
- {
- bstr_t t( std::distance(first, last) );
-
-#pragma warning(push)
-#pragma warning(disable:4996)
- std::copy(first, last, t.begin());
-#pragma warning(pop)
-
- swap(t);
- }
-
-
- //! Assignment operator from any (non integer) constructable.
- template
- bstr_t& operator=(const T& x)
- {
- COMET_STATIC_ASSERT( type_traits::is_integer::result == false );
- bstr_t t(x);
- swap(t);
- return *this;
- }
-
- //! Default assignment.
- bstr_t& operator=(const bstr_t& x) throw(std::bad_alloc)
- {
- bstr_t t(x);
- swap(t);
- return *this;
- }
-
- //! Concat operation
- bstr_t operator+(const bstr_t& s) const throw(std::bad_alloc)
- {
- return bstr_t(str_, length(), s.str_, s.length());
- }
-
- //! Concat with const wchar_t*
- bstr_t operator+(const wchar_t* s) const throw(std::bad_alloc)
- {
- return bstr_t(str_, length(), s, wcslen(s));
- }
-
- //! Concat with std::wstring
- bstr_t operator+(const std::wstring& s) const throw(std::bad_alloc)
- {
- return bstr_t(str_, length(), s.c_str(), s.length());
- }
-
- //! Concat assignment
- bstr_t& operator+=(const bstr_t& s) throw(std::bad_alloc)
- {
- bstr_t t(str_, length(), s.str_, s.length());
- swap(t);
- return *this;
- }
-
- //! Concat assignment with const wchar_t*
- bstr_t& operator+=(const wchar_t* s) throw(std::bad_alloc)
- {
- bstr_t t(str_, length(), s, wcslen(s));
- swap(t);
- return *this;
- }
-
- //! Concat assignment with std::wstring
- bstr_t& operator+=(const std::wstring& s) throw(std::bad_alloc)
- {
- bstr_t t(str_, length(), s.c_str(), s.length());
- swap(t);
- return *this;
- }
-
- // Detach a raw BSTR from it's wrapper - detach function is dangerous.
- BSTR detach()
- {
- BSTR s(str_);
- str_ = 0;
- return s;
- }
-
- public:
-
- //!\name Create a reference to a BSTR
- /*!
- Creates a bstr_t that is a reference to the BSTR.
- It will not be reference counted and will not be deleted when the bstr_t goes out of scope.
-
- This is used by the interface wrappers for [in] BSTR's. Typically clients do not need create_reference.
- */
- //@{
- static const bstr_t& create_const_reference(const BSTR& s) throw()
- { return *reinterpret_cast(&s); }
-
- static bstr_t& create_reference(BSTR& s) throw()
- { return *reinterpret_cast(&s); }
- //@}
-
- //! Detaches specified bstr
- static BSTR detach(bstr_t& s)
- {
- return s.detach();
- }
-
- /*! \internal */
- template
- static BSTR detach(const T& s)
- {
- return bstr_t(s).detach();
- }
-
- /*! \internal */
- BSTR* get_ptr_to_raw() const
- {
- return const_cast(&str_);
- }
-
- //! [in] adapter.
- /*!
- Used when calling raw interfaces that require an [in] BSTR argument.
-
- \code
- bstr_t bs;
- HRESULT hr = pRawInterface->raw_Method(bs.in());
- \endcode
-
- Only use this wrapper when forced to deal with raw interface.
- */
- BSTR in() const throw()
- {
- return str_;
- }
-
- //! [in] adapter.
- /*!
- Used when calling raw interfaces that require an [in] BSTR* argument.
-
- \code
- bstr_t bs;
- HRESULT hr = pRawInterface->raw_Method(bs.in_ptr());
- \endcode
-
- Only use this wrapper when forced to deal with raw interface.
- */
- BSTR* in_ptr() const throw()
- {
- return const_cast(&str_);
- }
-
- //! [out] adapter.
- /*!
- Used when calling raw interfaces that require an [out] BSTR * argument.
-
- \code
- bstr_t bs;
- HRESULT hr = pRawInterface->raw_MethodThatReturnsBSTR(bs.out());
- \endcode
-
- Only use this wrapper when forced to deal with raw interface.
- */
- BSTR* out() throw()
- {
- destroy();
- return &str_;
- }
-
- //! [in, out] adapter.
- /*!
- Used when calling raw interfaces that require an [in, out] BSTR * argument.
-
- \code
- bstr_t bs;
- HRESULT hr = pRawInterface->raw_MethodThatChangesBSTR(bs.inout());
- \endcode
-
- Only use this wrapper when forced to deal with raw interface.
-
- \note If the wrapped BSTR is shared. The bstr_t is copied so that only this version is modified.
-
- \exception std::bad_alloc
- Throws std::bad_alloc if the bstr_t is being copied and memory is exhausted.
- */
- BSTR* inout() throw(std::bad_alloc)
- {
- return &str_;
- }
-
- friend bstr_t operator+(const std::wstring& s, const bstr_t& t) throw(std::bad_alloc);
- friend bstr_t operator+(const wchar_t* s, const bstr_t& t) throw(std::bad_alloc);
- };
-
- //! Concat operation
- inline bstr_t operator+(const std::wstring& s, const bstr_t& t) throw(std::bad_alloc)
- {
- return bstr_t(s.c_str(), s.length(), t.str_, t.length());
- }
-
- //! Concat operation
- inline bstr_t operator+(const wchar_t* s, const bstr_t& t) throw(std::bad_alloc)
- {
- return bstr_t(s, wcslen(s), t.str_, t.length());
- }
- //@}
-
- /*! \name Boolean Operators on String
- * \relates bstr_t
- */
- //@{
- inline bool operator==(const wchar_t* s1, const bstr_t& s2) throw()
- {
- return s2 == s1;
- }
-
- inline bool operator!=(const wchar_t* s1, const bstr_t& s2) throw()
- {
- return s2 != s1;
- }
-
- inline bool operator<(const wchar_t* s1, const bstr_t& s2) throw()
- {
- return s2 > s1;
- }
-
- inline bool operator>(const wchar_t* s1, const bstr_t& s2) throw()
- {
- return s2 < s1;
- }
-
- inline bool operator<=(const wchar_t* s1, const bstr_t& s2) throw()
- {
- return s2 >= s1;
- }
-
- inline bool operator>=(const wchar_t* s1, const bstr_t& s2) throw()
- {
- return s2 <= s1;
- }
-
- inline bool operator==(const std::wstring& s1, const bstr_t& s2) throw()
- {
- return s2 == s1;
- }
-
- inline bool operator!=(const std::wstring& s1, const bstr_t& s2) throw()
- {
- return s2 != s1;
- }
-
- inline bool operator<(const std::wstring& s1, const bstr_t& s2) throw()
- {
- return s2 > s1;
- }
-
- inline bool operator>(const std::wstring& s1, const bstr_t& s2) throw()
- {
- return s2 < s1;
- }
-
- inline bool operator<=(const std::wstring& s1, const bstr_t& s2) throw()
- {
- return s2 >= s1;
- }
-
- inline bool operator>=(const std::wstring& s1, const bstr_t& s2) throw()
- {
- return s2 <= s1;
- }
- //@}
-
-
- // Implementation of uuid_t construct from bstr.
- inline uuid_t::uuid_t(const bstr_t& bs)
- {
- if (init_from_str(bs.c_str(), bs.length()) == false) throw std::runtime_error(err_msg());
- }
-
- inline currency_t& currency_t::parse( const bstr_t &str, LCID locale )
- {
- VarCyFromStr( str.in(), locale, 0, &cy_ ) | raise_exception;
- return *this;
- }
-
-} // namespace
-
-namespace {
- COMET_STATIC_ASSERT( sizeof(comet::bstr_t) == sizeof(BSTR) );
- COMET_STATIC_ASSERT( sizeof(comet::bstr_t) == sizeof(BSTR) );
-}
-
-namespace std {
- template<> inline void swap( comet::bstr_t& x, comet::bstr_t& y) COMET_STD_SWAP_NOTHROW { x.swap(y); }
-}
-
-#include
-
-#pragma warning(pop)
-
-#endif /* COMET_BSTR_H */
diff --git a/lib/local/CamCom/comet/calllog.h b/lib/local/CamCom/comet/calllog.h
deleted file mode 100644
index 0193f9b..0000000
--- a/lib/local/CamCom/comet/calllog.h
+++ /dev/null
@@ -1,628 +0,0 @@
-/** \file
- * Provide logging for calls.
- */
-/*
- * Copyright © 2003 Michael Geddes
- *
- * This material is provided "as is", with absolutely no warranty
- * expressed or implied. Any use is at your own risk. Permission to
- * use or copy this software for any purpose is hereby granted without
- * fee, provided the above notices are retained on all copies.
- * Permission to modify the code and to distribute modified code is
- * granted, provided the above notices are retained, and a notice that
- * the code was modified is included with the above copyright notice.
- *
- * This header is part of Comet version 2.
- * https://github.com/alamaison/comet
- */
-
-#ifndef COMET_CALLLOG_H
-#define COMET_CALLLOG_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/** \page cometcalllogging Call Logging
- This is a feature of the comet interfaces that allows the server to log all
- calls to any of the interface methods. It logs parameter values, and also allows
- logging of errors (see \ref comethandleexception ).
-
- Call logging in comet is enabled by using tlb2h -L (see \ref tlb2husage).
-
- To enable logging to a specified file, define COMET_LOGFILE and define
- COMET_LOGFILE_DEFAULT to be the required logfile (see comet::stream_call_logger_t).
-
- To override logging, specialise comet::call_logger_ and implement all the interfaces
- defined by the default comet::call_logger_.
-
- How various parameter types are output can be modified by specialising the
- function comet::comet_log.
- */
-
-/** \defgroup CallLog Call-logging
- *@{
- */
-#ifdef COMET_DOXYGEN // Only for doxygen
-/** \def COMET_LOGFILE
- * Define to get simple interface logfiles.
- * Must use tlb2h -L to enable interface logging. See \ref tlb2husage.
- * \sa comet_log comet_log_interface comet_log_array stream_call_logger_t tofstream_comet
- */
-
-#define COMET_LOGFILE
-
-/** \def COMET_LOGFILE_DEFAULT
- * If COMET_LOGFILE is defined, define to set the default logfile name.
- * \code
- #define COMET_LOGFILE_DEFAULT "C:\\log\\comet.log"
- * \endcode
- * \relates call_logger_
- */
-#define COMET_LOGFILE_DEFAULT "C:\\log\\comet.log"
-#endif // COMET_DOXYGEN
-
- //@}
-
-namespace comet
-{
-/*!\addtogroup CallLog
- */
-//@{
- /** \struct call_logger_ calllog.h comet/calllog.h
- * Default NULL logger and description of 'call logger' concept.
- * Specialise to \b true to override.
- * \code
- template<>
- struct call_logger_ : stream_call_logger_t
- {
- };
- * \endcode
- * \sa stream_call_logger_t tofstream_comet
- */
- template
- struct call_logger_
- {
- /** Should the call be logged?
- * \return Return true to allow call to be logged.
- */
- static inline bool can_log_call() { return false; }
- /** Should the return values be logged?
- * \return Return true to allow call return values to be logged.
- */
- static inline bool can_log_return() { return false; }
-
- /** Called by interfaces to provide call logging.
- */
- static inline void log_call( const tstring &iface, const tstring &funcname, const tstring &log){}
-
- /// Called by interfaces to provide call return logging.
- static inline void log_return( const tstring &iface, const tstring &funcname, const tstring &log, const tstring &retval){}
-
-
- ///\name Exception handling redirection.
- //@{
-
- /** Should the error be logged?
- * \return Return true to allow error to be logged.
- */
- static inline bool can_log_exception() { return false; }
-
- /// Called by exception handlers to provide logging for errors.
- static inline void log_exception(const tstring &type, const tstring &desc, const source_info_t &errorSource ,const source_info_t &callSource ){}
- //@}
- };
-
- /** \struct stream_call_logger_t calllog.h comet/calllog.h
- * Log calls to a tostream.
- * A class/struct that subscribes to and implements the 'call logger' concept for a steam.
- * Template paramter is expected to be a class that has a method that creates a tostream
- * instance as follows:
- * \code
- * static tostream *create()
- * \endcode
- * \param CREATESTREAM Class with a static function \p create() that returns a tostream *
- * \sa tofstream_comet call_logger_
- */
- template
- struct stream_call_logger_t
-#ifdef COMET_DOXYGEN // For documentation
- : call_logger_
-#endif
- {
- static inline bool can_log_call()
- {
- tostream *ofs = logger();
- return ofs != NULL && ofs->good();
- }
- static inline bool can_log_return() { return can_log_call(); }
- static inline bool can_log_exception() { return can_log_call(); }
-
- static inline void log_call( const tstring &iface, const tstring &funcname, const tstring &log)
- {
- log_( false, iface, funcname, log, tstring());
- }
- static inline void log_return( const tstring &iface, const tstring &funcname, const tstring &log, const tstring &retval)
- {
- log_( true, iface, funcname, log, retval);
- }
- static inline void log_exception(const tstring &type, const tstring &desc, const source_info_t &errorSource ,const source_info_t &callSource )
- {
- COMET_NOTUSED(errorSource);
- tostream *ofs= logger();
- if (ofs==NULL) return; // Should never be NULL, as can_log_call() should have been obeyed before calling.
- *ofs << _T("Err ") << callSource.source().t_str();
- if ( !desc.empty() )
- {
- *ofs << type << _T(": ") << desc ;
- }
- *ofs << std::endl;
- }
-
- protected:
- // Log a function call/return.
- static void log_( bool return_val, const tstring &iface, const tstring &funcname, const tstring &log, const tstring &retval)
- {
- tostream *ofs= logger();
- if (ofs==NULL) return; // Should never be NULL, as can_log_call() should have been obeyed before calling.
-
- *ofs << (return_val?_T("Out "):_T("In ")) << iface << _T("::") << funcname;
- if (!return_val || !log.empty())
- *ofs << _T("(") << log << _T(")");
-
- if (return_val && !retval.empty())
- *ofs << _T(" returned ") << retval;
- *ofs << std::endl;
-
- }
- // Access to the static logger instance without needing to initialise a
- // member.
- static tostream *logger()
- {
- static tostream *ofs_= NULL;
- if (ofs_ ==NULL)
- {
- ofs_ = CREATESTREAM::create();
- if (ofs_ != NULL)
- {
- // Safely clean up static pointer on module destruct
- module().add_object_to_dispose( create_pointer_deleter( ofs_ ) );
- }
- }
- return ofs_;
- }
- };
-
- namespace impl
- {
- /** Redirect default logging to calllog.
- * \internal
- */
- template<>
- struct call_logger_redirect_
- {
- // This trick allows the user to be able to still override the call logging.
- // Without this, log_exception has to call
- // call_logger_::log_exception which causes the template to be
- // instantiated, and the user is no longer able to specialise
- // call_logger_
- template
- struct exe
- {
- static inline void log_exception(const tstring &type, const tstring &desc, const source_info_t &errorSource, const source_info_t &callSource )
- {
- call_logger_::log_exception(type,desc,errorSource, callSource);
- }
- static inline bool can_log_exception()
- {
- return call_logger_::can_log_exception();
- }
- };
- };
- }
-
-#ifdef COMET_LOGFILE
-#ifndef COMET_LOGFILE_DEFAULT
-#define COMET_LOGFILE_DEFAULT NULL
-#endif
-#include
- /** \class tofstream_comet calllog.h comet/calllog.h
- * Provides a filestream creator as well as the implementation of an output filestream logger.
- * Allows overriding of file name.
- */
- class tofstream_comet : public tofstream
- {
- static const char *&filename_()
- {
- static const char *default_filename= COMET_LOGFILE_DEFAULT;
- return default_filename;
- }
- public:
- /// Get the default filename.
- static const char *get_default_filename() { return filename_(); }
- /// Set the default filename to a new value.
- void set_default_filename( const char *filename) { filename_() = filename; }
-
- tofstream_comet( const char *fname) : tofstream(fname) {}
-
- /** Create an instance of the logger.
- * Returns NULL if the file doesn't exist.
- */
- static tostream *create()
- {
- const char *fname = filename_();
- if (fname == NULL)
- return NULL;
- return new tofstream_comet(fname);
- }
- private:
- tofstream_comet(const tofstream_comet &);
- tofstream_comet &operator=(const tofstream_comet &);
-
- };
-
- /** Override specialisation of the call_logger_.
- * \relates call_logger_
- */
- template<>
- struct call_logger_ : public stream_call_logger_t
- {
- };
-
-#endif // FILE_LOG
-
- /** Default interface (com_ptr) logging.
- * Specialise to provide custom logging for com_ptr.
- \code
- template<>
- void comet_log_interface(tostream &os, const com_ptr &iface)
- {
- os << iface->GetName();
- }
- \endcode
- Specialisations for IUnknown and IDispatch are used by the variant loggers.
- * \sa comet_log comet_log_array
- * \relates call_logger_
- */
- template< typename IFACE>
- void comet_log_interface(tostream &os, const com_ptr &iface)
- {
- os << _T("0x") << std::hex << reinterpret_cast(iface.get()) << std::dec;
- }
-
- // Forward declarations.
- template void comet_log(tostream &os, const T &value);
-
- namespace impl
- {
- // Forward declarations.
- template inline void default_comet_log(tostream &os, const T &value);
- static void comet_log_array_raw(tostream &os, SAFEARRAY *value);
-
- // The default variant handler.
- template< bool B>
- static inline void default_comet_log_variant(tostream &os, const variant_t &value, bool out_type)
- {
- VARTYPE vt = value.get_vt();
- if ((vt & VT_ARRAY) != 0)
- {
- comet_log_array_raw(os, value.get().parray);
- }
- else
- {
- VARIANT varcopy=value.in();
- if (vt == (VT_BYREF | VT_VARIANT)) // Dereference variant by reference
- varcopy = *V_VARIANTREF(&varcopy);
- const VARIANT *var=&varcopy;
-
-#define __VARIANT_LOGPOINTER_TYPE_CAST(vartype,cast) \
- case VT_##vartype:\
- if(out_type) os << _T("VT_")_T(#vartype)_T(":");\
- comet_log_interface(os, cast(V_##vartype(var))); \
- break
-
-#define __VARIANT_LOGPOINTER_REFTYPE_CAST(vartype,cast) \
- case VT_BYREF|VT_##vartype:\
- if(out_type) os << _T("BYREF VT_")_T(#vartype)_T(":");\
- comet_log_interface(os, cast(*V_##vartype##REF(var)));\
- break
-#define __VARIANT_LOG_TYPE_CAST(vartype,cast) \
- case VT_##vartype: \
- if(out_type) os << _T("VT_")_T(#vartype)_T(":"); \
- comet_log(os, cast(V_##vartype(var))); \
- break
-
-#define __VARIANT_LOG_REFTYPE_CAST(vartype,cast)\
- case VT_BYREF|VT_##vartype:\
- if(out_type) os << _T("BYREF VT_")_T(#vartype)_T(":");\
- comet_log(os, cast(*V_##vartype##REF(var)));\
- break
-
-#define __VARIANT_LOG_TYPE(vartype) \
- case VT_##vartype: \
- if(out_type) os << _T("VT_")_T(#vartype)_T(":");\
- comet_log(os, V_##vartype(var));\
- break
-
-#define __VARIANT_LOG_REFTYPE(vartype)\
- case VT_BYREF|VT_##vartype: \
- if(out_type) os << _T("BYREF VT_")_T(#vartype)_T(":"); \
- comet_log(os, *V_##vartype##REF(var)); \
- break
-
- switch (vt)
- {
- __VARIANT_LOG_TYPE(UI1);
- __VARIANT_LOG_TYPE(UI2);
- __VARIANT_LOG_TYPE(UINT);
- __VARIANT_LOG_TYPE(UI4);
- __VARIANT_LOG_TYPE(I1);
- __VARIANT_LOG_TYPE(I2);
- __VARIANT_LOG_TYPE(INT);
- __VARIANT_LOG_TYPE(I4);
- __VARIANT_LOG_TYPE(R4);
- __VARIANT_LOG_TYPE(R8);
- __VARIANT_LOG_REFTYPE(UI1);
- __VARIANT_LOG_REFTYPE(UI2);
- __VARIANT_LOG_REFTYPE(UINT);
- __VARIANT_LOG_REFTYPE(UI4);
- __VARIANT_LOG_REFTYPE(I1);
- __VARIANT_LOG_REFTYPE(I2);
- __VARIANT_LOG_REFTYPE(INT);
- __VARIANT_LOG_REFTYPE(I4);
- __VARIANT_LOG_REFTYPE(R4);
- __VARIANT_LOG_REFTYPE(R8);
-
- case VT_BOOL:
- if(out_type) os << _T("VT_BOOL:");
- os << (V_BOOL(var)==VARIANT_FALSE)?_T("true"):_T("false");
- break;
- case VT_BYREF|VT_BOOL:
- if(out_type) os << _T("BYREF VT_BOOL:");
- os << (V_BOOL(var)==VARIANT_FALSE)?_T("true"):_T("false");
- break;
- __VARIANT_LOG_TYPE_CAST( CY, currency_t::create_const_reference);
- __VARIANT_LOG_REFTYPE_CAST( CY, currency_t::create_const_reference);
- __VARIANT_LOG_TYPE_CAST( DATE, datetime_t::create_const_reference);
- __VARIANT_LOG_REFTYPE_CAST( DATE, datetime_t::create_const_reference);
- __VARIANT_LOG_TYPE_CAST( BSTR, bstr_t::create_const_reference);
- __VARIANT_LOG_REFTYPE_CAST( BSTR, bstr_t::create_const_reference);
-
- __VARIANT_LOGPOINTER_TYPE_CAST( UNKNOWN, com_ptr::create_const_reference);
- __VARIANT_LOGPOINTER_TYPE_CAST( DISPATCH, com_ptr::create_const_reference);
- __VARIANT_LOGPOINTER_REFTYPE_CAST( UNKNOWN, com_ptr::create_const_reference);
- __VARIANT_LOGPOINTER_REFTYPE_CAST( DISPATCH, com_ptr::create_const_reference);
-
- case VT_DECIMAL:
- if(out_type) os << _T("BYREF VT_DECIMAL:");
- os << _T("?");
- break;
- case VT_ERROR:
- if(out_type) os << _T("VT_ERROR:");
- os <<_T("0x") << std::hex << V_ERROR(var) << std::dec;
- break;
- case VT_BYREF|VT_ERROR:
- if(out_type) os << _T("BYREF VT_ERROR:");
- os <<_T("0x") << std::hex << *V_ERRORREF(var) << std::dec;
- break;
- default:
- os << _T("???");
- }
-#undef __VARIANT_LOG_TYPE_CAST
-#undef __VARIANT_LOG_REFTYPE_CAST
-#undef __VARIANT_LOG_TYPE
-#undef __VARIANT_LOG_REFTYPE
-#undef __VARIANT_LOGPOINTER_TYPE_CAST
-#undef __VARIANT_LOGPOINTER_REFTYPE_CAST
- }
- }
-
- /* Logging for raw safearrays.
- * For vector arrays of size <= 16, this fakes a variant and then uses the default variant logging to log the elements
- */
- static void comet_log_array_raw(tostream &os, SAFEARRAY *value)
- {
- UINT dims = SafeArrayGetDim(value);
- VARTYPE vt ;
- if( FAILED(SafeArrayGetVartype(value, &vt ) ) )
- {
- os << "???";
- return;
- }
-
- long ubound=-1,lbound=0; // Outside so it can be used for the '1' case below.
- for (UINT d = 1; d<= dims ; ++d)
- {
- if( SUCCEEDED(SafeArrayGetUBound( value, d, &ubound) ) && SUCCEEDED(SafeArrayGetLBound(value, d, &lbound) ))
- {
- if( lbound == 0)
- os << _T("[") << ubound+1 << _T("]");
- else
- os << _T("(") << lbound << _T("..") << ubound << _T(")");
- }
-
- }
- if (dims == 1 )
- {
- long size = 1+ubound-lbound;
- if (size ==0)
- {
- os << _T("{}");
- }
- else if( size > 0 && size <= 15)
- {
- // For small arrays, print out the elements.
- os << _T("{");
- VARIANT v;
- void *var;
- bool first=true, is_variant= (vt==VT_VARIANT);
- if ( is_variant)
- var = (void *)&v;
- else
- {
- V_VT(&v) = vt;
- var = (void *)&V_UI1(&v);
- }
-
- for (long i = lbound; i <= ubound; ++i )
- {
- if(first)
- first = false;
- else
- os << _T(",");
- if( SUCCEEDED( SafeArrayGetElement( value, &i, var ) ))
- default_comet_log_variant( os, variant_t(auto_attach(v)), first | is_variant);
- }
- os << _T("}");
- }
- }
- }
-
- // Default logging: stream the value.
- template
- inline void default_comet_log(tostream &os, const T &value)
- {
- // ERRORS: If a compiler error occurs here, you may need to
- // specialise comet_log<> to the type T here.
- os << value;
- }
- // Default logging for bstr_t
- template<>
- inline void default_comet_log(tostream &os, const bstr_t &value)
- {
- // Put quotes round the string - simplistic, don't worry about
- // non-printables or escaping for the moment.
- os << _T("'") << value << _T("'");
- }
-
- // Deafult logging for variants.
- template<>
- static inline void default_comet_log(tostream &os, const variant_t &value)
- {
- default_comet_log_variant( os, value, true);
- }
- }
-
- /** Type specific logger.
- * The default is to use internal logging. This can be specialised to
- * provide type-specific logging.
- * \sa comet_log_array comet_log_interface
- * \relates call_logger_
- */
- template
- void comet_log(tostream &os, const T &value)
- {
- impl::default_comet_log(os,value);
- }
-
- namespace impl
- {
- // trick to work out whether it is a safearray or com_ptr type (required because of no
- // partial specialisation). Needed to handle the special circumstances
- template
- struct check_log_type_
- {
- static long check(...);
-
- template
- static char check(const safearray_t &);
-
- template
- static short check( const com_ptr &);
-
- static T createT();
- enum { is = sizeof( check( createT() ) ) };
-
- };
- template < int TYPE> struct choose_logger;
-
- // Default safearray_t logger where we know the type T.
- //
- template
- inline void default_comet_log_array(tostream &os, const safearray_t &value)
- {
- safearray_t::index_type lbound=value.lower_bound(), size = value.size();
- if (lbound == 0)
- os << _T("[") << size << _T("]");
- else
- os << _T("(") << lbound << _T("..") << (lbound + size -1) << _T(")");
-
- if( value.size() <= 15)
- {
- os << _T("{");
- bool first = true;
- for (safearray_t::const_iterator it = value.begin(); it != value.end(); ++it)
- {
- choose_logger::is >::do_comet_log(os, *it);
- if (first)
- first=false;
- else
- os << _T(",");
- }
- os << _T("}");
- }
- }
- }
- /** Typed safearray_t logger.
- * The default is to use internal logging. This can be specialised to
- * provide type-specific logging.
- * \sa comet_log comet_log_interface
- * \relates call_logger_
- */
- template
- void comet_log_array(tostream &os, const safearray_t &value)
- {
- impl::default_comet_log_array(os,value);
- }
-
- namespace impl
- {
- // choose the standard logger
- template < int TYPE>
- struct choose_logger
- {
- template
- static inline void do_comet_log(tostream &os, const T &value)
- {
- comet_log(os,value);
- }
- };
- // Choose the array logger
- template<>
- struct choose_logger
- {
- template
- static inline void do_comet_log(tostream &os, const safearray_t &value)
- {
- comet_log_array(os, value);
- }
- };
- // Choose the interface logger
- template<>
- struct choose_logger
- {
- template
- static inline void do_comet_log(tostream &os, const com_ptr &value)
- {
- comet_log_interface(os, value);
- }
- };
-
- // Choose which of the comet_loggers to use.
- template
- static inline tostream &do_comet_log(tostream &os, const T &value)
- {
- choose_logger::is >::do_comet_log(os, value);
- return os;
- }
- }
- //@}
-}
-
-#endif /* COMET_CALLLOG_H */
diff --git a/lib/local/CamCom/comet/cmd_line_parser.h b/lib/local/CamCom/comet/cmd_line_parser.h
deleted file mode 100644
index 65c4178..0000000
--- a/lib/local/CamCom/comet/cmd_line_parser.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/** \file
- * Command line parser.
- */
-/*
- * Copyright © 2002 Mikael Lindgren
- *
- * This material is provided "as is", with absolutely no warranty
- * expressed or implied. Any use is at your own risk. Permission to
- * use or copy this software for any purpose is hereby granted without
- * fee, provided the above notices are retained on all copies.
- * Permission to modify the code and to distribute modified code is
- * granted, provided the above notices are retained, and a notice that
- * the code was modified is included with the above copyright notice.
- *
- * This header is part of Comet version 2.
- * https://github.com/alamaison/comet
- */
-
-#ifndef COMET_COMMAND_LINE_PARSER_H
-#define COMET_COMMAND_LINE_PARSER_H
-
-#include
-
-namespace comet {
-
- /*! \addtogroup Misc
- */
- //@{
- class cmd_line_parser
- {
- public:
- enum kind_t {
- Name, // Name type token, has no leading / or -
- Option, // Option type token. Leading / or - skipped by token
- Value, // Value for name or option. Leading : or = skipped by token
- Done // No more tokens
- };
-
- explicit cmd_line_parser(const TCHAR* cmd_line): cmd_line_(cmd_line)
- {
- reset();
- }
-
- kind_t get_next_token(tstring& result)
- {
- static const TCHAR terminators[] = _T("=/- \t");
- static const TCHAR white_space[] = _T(" \t");
-
- kind_t kind;
-
- token_ = next_token_ + _tcsspn(next_token_, white_space); // Skip leading whitespace
- switch (*token_)
- {
- case 0:
- return Done;
- case _T('-'):
- case _T('/'):
- kind = Option;
- ++token_;
- break;
- case _T('='):
- kind = Value;
- ++token_;
- break;
- default:
- kind = Name;
- break;
- }
- if (kind == Option || kind == Value)
- token_ += _tcsspn(token_, white_space); // Skip any more whitespace
- if (*token_ == _T('"'))
- {
- const TCHAR* next = _tcschr(token_+1, _T('"'));
- if ( next )
- {
- result.assign( token_+1, next );
- next_token_ = next+1;
- return kind;
- }
- }
- next_token_ = token_ + _tcscspn(token_, terminators);
- result.assign(token_, next_token_);
- return kind;
- }
-
- void reset()
- {
- token_ = 0;
- next_token_ = cmd_line_;
- }
-
- private:
- const TCHAR* cmd_line_;
- const TCHAR* token_;
- const TCHAR* next_token_;
- };
- //@}
-
-}
-
-#endif
diff --git a/lib/local/CamCom/comet/comet.h b/lib/local/CamCom/comet/comet.h
deleted file mode 100644
index b2ad70f..0000000
--- a/lib/local/CamCom/comet/comet.h
+++ /dev/null
@@ -1,776 +0,0 @@
-/** \file
- * Load basic comet libraries.
- */
-/*
- * Copyright © 2000, 2001 Sofus Mortensen, Michael Geddes
- *
- * This material is provided "as is", with absolutely no warranty
- * expressed or implied. Any use is at your own risk. Permission to
- * use or copy this software for any purpose is hereby granted without
- * fee, provided the above notices are retained on all copies.
- * Permission to modify the code and to distribute modified code is
- * granted, provided the above notices are retained, and a notice that
- * the code was modified is included with the above copyright notice.
- *
- * This header is part of Comet version 2.
- * https://github.com/alamaison/comet
- */
-
-#ifndef COMET_COMET_H
-#define COMET_COMET_H
-
-#include
-
-/**
- @mainpage Comet
-
- See https://github.com/alamaison/comet
-
- See \ref comethistory.
-
- \section cometinfocontents Information Pages
-
- \ref tlb2husage
- \ref tlb2handidl
- \ref cometcomptr
- \ref cometrawcomaccess
- \ref cometconnectionpoints
-
- \ref cometconnectionpointssource
- \ref cometconnectionpointsink
-
- \ref comettstring
- \ref cometdefineconfiguration
- \ref cometcatchallexception
- \ref cometclassfactory
- \link custom_registration Custom Registration\endlink
- \ref comethandleexception
- \ref cometcalllogging
- \ref cometautoexp
-
-
- */
-
-/**
- * \page cometrawcomaccess Raw COM Acces
- * The designers of Comet have tried to avoid making the wrappers do too much
- * implicitly, prefering discrete but explicit ways of triggering functionality.
- *
- * In order to provide interaction of Comet classes with their COM counterparts,
- * a standard set of methods have been used, effectively providing a COM wrapper
- * concept .
- *
- *
- * in() : Return a pointer suitable for [in] parameters,
- * out() : Return a pointer suitable for [out] parameters, first freeing memory allocated,
- * inout() : Return a pointer suitable for [in,out] parameters.
- * detach() : Detach and return the internal pointer from the object
- * in_ptr() : {optional} Return a pointer suitable for [out] parameter where a pointer is required, first freeing memory allocated
- * get() : {optional} Returns a pointer to the internal pointer (same as STL pointers)
- * auto_attach( RAW_TYPE ) : Cause an assignment to attach the object to the specified raw COM type.
- * create_reference( RAW_TYPE ) : Static method to create a propper wrapper reference to the specified raw object.
- * create_const_reference( RAW_TYPE ) : Static method to create a const wrapper reference to the specified raw object.
- *
- */
-
-/** \page cometcatchallexception Exception Catching Policy
-In an ideal world, Microsoft would have adhered to the C++ standard, and made
-catch(...) not catch system exceptions like 'Access Violation',
-however this is not the case.
-
-To make it worse, not only do system exceptions get caught by catch(...) ,
-they also bypass the stack unwinding . This is quite problematic in an
-environment where this mechanism is relied upon for resource management, commonly
-'only' memory, but also including multithreading acces control mechanisms.
-
-One of the big problems with Access Violations is that it is an unplanned
-exception, and in many situations will leave data structures incomplete,
-resources locked or other equally vicious artifacts. Essentially, it breaks
-invariants. One viable take on this is that if you don't know where an
-exception came from, you shouldn't be catching it.
-
-A big advantage of letting access violations and it's ilk (or any other
-unplanned exception) through is that these will then get caught by the JIT (Just
-In Time) handlers such as Dr. Watson and Compiler environments that allow
-immediate or post-mortem debugging of the problem. A lot of projects (like
-Mozilla) have their own bug-reporting which can intercept the bugs at the top
-level and generate their own crash dumps, and catching these exceptions is
-actually going to bypass a very useful mechanism.
-
-All this is to say that we have made a shift away from exception handling
-policies that cause system expeptions to be caught, however in order to
-allow as much flexibility as possible, an improved exception handling mechanism
-has been added to the interface implementations and to the server implementation
-that uses catch and rethrow to allow logging and custom handling of all exceptions.
-
-The default action of the mechanisms will be to finally rethrow unknown
-exceptions. The good thing about this is that the rethrow behaves to a JIT handler
-as if the expeption had never been caught.
-
-*/
-
-/** \page cometautoexp Comet AutoExp.Dat Support
-There is a largely undocumented feature is Visual Studio 6 and 7 that allows
-you to create a dll 'ADDIN' that provides custom formatting for variables in the
-debugger. CometAutoExp.dll allows you to view simple automation types in more
-detail than currently provided internally by the debugger.
-
-By enabling this, you will get to see real date/times when you view datetime_t, you
-get to see SAFEARRAY types (including IIDs), and possibly their contents, you
-will see full VARIANT types, including SAFEARRAYs.
-
-The file in comet/src/cometautoexp/AutoExp.dat shows the entries that will
-be needed to included in your own AutoExp.dat for this to work. (Usually
-found at "c:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin\AUTOEXP.DAT")
-
-See \ref cometautoexpusage for more information on how to use this.
- */
-
-/** \page cometdefineconfiguration Comet Configuation
- While Comet barely uses macros for the import work of creating a COM library,
- there are a number of preprocessor switches that are used to alter certain
- behaviours and select code. While most of these refer to the compiler being used,
- there are a few that are intended to be used as external switches.
-
- COMET_ALLOW_DECLSPEC_PROPERTY : Wrapper headers include declspec
- properties, allowing interface properties to be assigned-to and read as
- properties. COMET_ASSERT_THROWS : Comet throws
- comet::assert_failed when internal assertions fail in debug builds.
- COMET_ASSERT_THROWS_ALWAYS : Comet throws comet::assert_failed when
- internal assertions fail in both debug and release builds.
- COMET_LOGFILE : See \ref cometcalllogging.
- COMET_LOGFILE_DEFAULT : See \ref cometcalllogging.
- COMET_NO_MBCS : Disable comet multi-byte-character-set conversion handling.
- COMET_NO_MBCS_WARNING : Turn off the warning indicating that sdt::string is not compatible with MBCS.
- COMET_USE_RAW_WRAPPERS : Tells com_ptr not to use the comet wrappers but to return raw interface pointers.
-
-
- There are also a number of macros that are either utitlity macros, reflect compiler differences
- or Comet version differences that may be convenient to use within your own code.
-
-
- COMET_ASSERT(expression) : Run-time assert.
- COMET_STATIC_ASSERT(static-expression) : Compile-time assert.
- COMET_NOTUSED(info) : Specify unused argument.
- COMET_FORCEINLINE : Use before a method to apply force-inline if available.
- COMET_VARIANT_TRUE,COMET_VARIANT_FALSE : Use in place of VARIANT_TRUE,VARIANT_FALSE to avoid type warnings.
- COMET_MAJOR_VER : Major comet version
- COMET_MINOR_VER : Minor comet version
- COMET_BUILD : Comet version to compare against (yyyymmdd of distribution)
- COMET_STRICT_TYPENAME : Used for when stricter compilers require 'typename' keyword and VC6 has an error.
- COMET_CONST_TYPE(vartype, varname, value) : Define a typed constant for a class/struct (or use enum if not supported)
-
-
- */
-
-/** \page comethistory Comet History
-\par Version 1 gamma 32 ( )
-\li Support for VC++2005 (Sofus Mortensen)
-\li Numerous bug fixes and better support for Intel C++ (Richard Crossley)
-\li Fixed off-by-one bug regarding array sizes (Yunusov Bulat)
-
-\par Version 1 beta 31 ( )
-\li safearray.h - Fix a few omissions/bugs (Lijun Qin)
-\li comet_lint.lnt - Add pclint options file. (Michael Geddes)
-\li server.h - Fix singlton_autorelease class (Ralf Jürgensen)
-\li datetime.h - Fix bug in century non-leap-years. (Michael Geddes)
-\li datetime.h - Use julian date conversions from boost - to drastically improve split/join efficiency (Michael Geddes)
-\li datetime.h - Make invalid() rather than valid() the default (Michael Geddes)
-\li date.h - Make use of above improvements in datetime_t (Michael Geddes)
-\li datetime.h/date.h - Add ability to construct/assign invalid/null dates from dt_null, dt_invalid (Michael Geddes)
-\li datetime.h - Fixed bug in to_unixtime (Lijun Qin)
-\li array.h - Fixed typename problem (Sofus Mortensen)
-\li safearray.h - Fixed problem with sa_debug_iterator and MSVC 7.1 (Sofus Mortensen)
-\li uuid_fwd.h - Fixed bug in !operator (Sofus Mortensen)
-
-\par Version 1 beta 30 (2004-3-5)
-\li Support for VC7.1 partial specialisation. (Lijun Qin)
-\li datetime.h - Bugfix in datetime_t conversion (Gordon Donaldson)
-\li safearray.h - Separate safearray_t::resize into resize and resize_bound to avoid ambiguous conversions. (Michael Geddes)
-\li safearray.h - Fix bug in safearray_t:resize_bound using an incorrect copy. (Michael Geddes)
-\li safearray.h - Add safearray_t debug iterator for debug builds. (Michael Geddes)
-\li safearray.h - Add more comments for safearray_t (Michael Geddes)
-\li safearray.h - Support more container-type methods (erase,push_front,push_back,pop_front,pop_back) (Michael Geddes)
-\li server.h - Add auto-release singleton (Michael Geddes)
-\li uuid.h - uuid_t::operator! no longer reversed (Lijun Qin)
-\li uuid.h - fix ambiguous ++ operator usage. (Lijun Qin, Bulat Raditch, Michael Geddes)
-\li handle.h - Extension of handles for GDI objects for cometw (Michael Geddes/Vladimir Voinkov/Lindgren Mikael)
-\li bstr.h - Throw comparison errors if they occur. (Michael Geddes)
-\li cp.h - add 'is_connected' method to connection points. (Lijun Qin)
-\li common.h - Support for pclint (Michael Geddes, Gabriel Barta)
-\li datetime.h - Support for timezones (Michael Geddes)
-\li datetime.h - Fix up buffer handling (Michael Geddes, Lijun Qin)
-\li variant.h - Support for strings with embedded nulls (Michael Geddes)
-\li tlb2h - Support for bool in structs and in safearrays (Michael Geddes)
-\li tlb2h - Support for wrapper renaming of specific methods on specific interfaces/struct/unions. (Michael Geddes)
-\li tlb2h - Dual interfaces inherited from an interface in a different type-library now works when called by dispatch (Michael Geddes)
-\li tlb2h - Output of HTML now better restricted to only required interfaces. (Michael Geddes)
-\li tlb2h - Obey COM rules that require [out] pointers to be initialised on failure (Michael Geddes)
-\li tlb2h - Support implementation of an interface that inherits from an interface from a different typelibrary (Michael Geddes)
-\li cometautoexp - Support for more types, and better handling of strings. (std::basic_string, COLEDateTime) (Michael Geddes)
-\li date.h - Added dateonly_t class. (Michael Geddes)
-\li uuid.h - Make the strings accessors consistant (Michael Geddes, Lijun Qin)
-
-\par Version 1 beta 29 (2003-12-30)
-\li Added loads of documentation, reduced doxygen warnings to 1(Michael Geddes)
-\li Added CometAutoExp.dll extended support for AutoExp.dat
-\li Remove unnecessary catch(...) - use specific catches (Michael Geddes)
-\li Support create_const_reference in all wrapper classes. (Michael Geddes)
-\li tlb2h - Enhance support for error information (interface/coclass name) (Michael Geddes)
-\li tlb2h - Add support for logging calls & exceptions. (Michael Geddes)
-\li tlb2h - Support for special characters in help strings. (Michael Geddes)
-\li tlb2h - Few tweaks to get correct output. (Michael Geddes)
-\li tlb2h - Option to show version (Michael Geddes)
-\li bstr.h - Work with _STLP_DEBUG wrappers (Michael Geddes)
-\li bstr.h - Constructor works with MBCS (Michael Geddes)
-\li bstr.h - Support for {} round uuid_t (Michael Geddes)
-\li cp.h - Add convenience methods. (Michael Geddes)
-\li datetime.h - Constructor to supply date and time (Michael Geddes)
-\li datetime.h - Support output streams. (Michael Geddes)
-\li error.h - Support for source, iid and helpfile in errors. (Michael Geddes)
-\li interface.h - Provide extra comtype definitions. (Michael Geddes)
-\li interface.h - Provide convenience macro to define extra comtype with IID_ instances. (Michael Geddes)
-\li ptr.h - Add identity_ptr class that references an identity IUnknown. All other comparisons QI on both pointers. (Michael Geddes)
-\li server.h - Add support for singelton classes. (Michael Geddes)
-\li tlbinfo.h - Fix up reference counting on struct wrappers. (Michael Geddes)
-\li tlbinfo.h - Support ITypeInfo2 (Michael Geddes)
-\li variant.h - Added explicit converts (as_uchar(), as_uint(), as_double() etc) (Michael Geddes)
-\li variant.h - Added is_empty(), is_null() and is_nothing() (Michael Geddes)
-
-\par Version 1 beta 28 (2003-6-18)
-\li Support for Visual Studio 2003
-
-\par Version 1 beta 27 (2003-3-5)
-\li tlb2h - bug fix variant_t members of dispinterfaces (Michael Geddes)
-\li tlb2h - support for safearrays of interfaces (Michael Geddes)
-
-\par Version 1 beta 26 (2003-2-1)
-\li tlb2h - major update. See http://groups.yahoo.com/group/tlb2h/message/706 (Michael Geddes)
-\li Enum.h - allow copy policies with members (Michael Geddes)
-\li datetime.h - fixed bug in timeperiod_t::split (Michael Geddes)
-
-\par Version 1 beta 25 (2002-11-28)
-\li Connection point implementation is now customisable via traits. See http://groups.yahoo.com/group/tlb2h/message/688 (Michael Geddes)
-\li Fixed bug in str_formattime in datetime.h (Sofus Mortensen).
-\li Fixed bug in add_months in datetime.h (Michael Geddes).
-
-\par Version 1 beta 24 (2002-11-13)
-\li Major update of tlb2h. See http://groups.yahoo.com/group/tlb2h/message/659 and http://groups.yahoo.com/group/tlb2h/message/661. (Michael Geddes)
-\li Fixed problem with variant_t::operator==. (Kyle Alons)
-\li Fixed bug in bstr_t::s_str(), bstr_t::is_empty(), bstr_t::length() (Mikael Lindgren, Michael Geddes)
-\li safearray_t: 1. Changed the constructor that takes two iterators to not have a default lowerbound (to be consistant with the other constructor)
-2. Changed resize to allow specifying a lower-bound.
-3. Changed the default lb to be 0 in the case where none is specified and where the safearray is NULL. (Michael Geddes)
-
-\par Version 1 beta 23 (2002-9-1)
-\li Bug fixes to namespace handling. (Michael Geddes)
-\li Added friendly error message for missing tlbinf32.dll. (Sofus Mortensen)
-\li Worked around MSVC6 internal compiler error when contructing an enum. (Michael Geddes)
-\li Bug fixes to currency.h (Michael Geddes)
-\li Bug fixes to datetime.h (Michael Geddes)
-
-\par Version 1 beta 22 (2002-8-19)
-\li Update of tlb2h - better handling of namespace mangling, and support for
-unwrapping the type of aliases without unwrapping the name of the aliases (Michael Geddes).
-\li Fixed bug in uuid_fwd. (John Harrison)
-\li Added oleidl_comtypes.h. (Gabriel Barta)
-\li Restored old functionality of try_cast - will no longer throw when casting a null pointer. (Sofus Mortensen)
-\li New auto-locking implementation of safearray_t::create_reference and safearray_t::create_const_reference. (Michael Geddes, Sofus Mortensen)
-\li Included first drop (pre-alpha version) of cometw. (Vladimir Voinkov)
-
-\par Version 1 beta 21 (2002-6-21)
-\li Fixed null pointer bug in com_error::what(). (Kyle Alons)
-\li Fixed bug to do with the unloading of typelibraries when refcount reaches zero. (Michael Geddes)
-\li Added support for MBCS to std::string and const char* conversions for bstr_t. Only active when _MBCS is defined. (Michael Geddes)
-\li Fixed locking/unlocking bug. (Vladimir Voinkov, Sofus Mortensen)
-\li Fixed bug in safearray_t::create_reference(variant_t&). (Michael Geddes)
-\li Various fixes to datetime and currency. (Michael Geddes)
-\li Added constants COMET_VARIANT_TRUE and COMET_VARIANT_FALSE in order to avoid warnings. (Michael Geddes, Sofus Mortensen)
-\li registry::value has been extended with overload for method str and dword, where a default value can be supplied if the key/value does not exist. (Sofus Mortensen)
-\li Various patches for BCC. (Michael Geddes)
-\li Solved problem with vtables gaps when inheriting from those interfaces. (Michael Geddes)
-\li Removed a few level 4 warnings. (Michael Geddes)
-\li Added experimental HTML generation to tlb2h. (Sofus Mortensen)
-
-\par Version 1 beta 20 (2002-4-9)
-\li tlb2h will fall back to using raw structs for structs with types that cannot be wrapped. (Sofus Mortensen)
-\li Added application wizard for MSVC.NET. See tlb2h/src/Comet. (Sofus Mortensen)
-\li Eliminated a few warnings. (Sofus Mortensen)
-
-\par Version 1 beta 19 (2002-3-26)
-\li Added caching of IRecordInfo to sa_traits for wrapped structs and ITypeInfo to IDispatch implementations. (Sofus Mortensen)
-\li Fixed problem with safearray_t iterators on MSVC7. (Sofus Mortensen)
-\li Fixed bug regarding range checking for safearray_t::at being off by one. (Sofus Mortensen)
-\li Added range checking assertion (debug only) to safearray_t::operator[]. (Sofus Mortensen)
-\li Changed safearray_t constructor, so that lower bound of one is no longer assumed. Instead lower bound must be specified. (Sofus Mortensen)
-
-\par Version 1 beta 18 (2002-3-25)
-\li Major revision of bstr_t. (Sofus Mortensen)
-\li Added experimental support for wrapped structs to tlb2h and safearray. (Sofus Mortensen)
-\li Fixed problem with having a coclass as a connection point sink. (Sofus Mortensen)
-\li Revised treatment of [in, out] parameters in tlb2h. The old implementation could cause double deletion of [in. out] parameters when an exception was thrown. (Sofus Mortensen)
-\li Revised all wrapper classes, in order for create_reference to create a mutable reference and create_const_reference an immutable reference. (Sofus Mortensen)
-\li Revised locking in safearray_t. safearray_t::create_reference and safearray_t::create_const_reference is no longer doing automatic locking. (Sofus Mortensen)
-\li tlb2h now generates #import alike smart pointer typedef. Ie. interface IFoo will be matched with a typedef com_ptr IFooPtr. (Sofus Mortensen)
-\li Added support for datetime_t and currency_t to safearray_t. (Sofus Mortensen)
-\li Added t_str() to bstr_t for converting to tstring. (Sofus Mortensen)
-
-\par Version 1 beta 17 (2002-2-18)
-\li Fixed bug in atl_module. (Michael Geddes)
-\li Documentation update for bstr.h. (Michael Geddes)
-\li bstr_t now supports strings with embedded nulls. Thanks to Eric Friedman for reporting this. (Sofus Mortensen)
-\li Removed use of _alloca in bstr.h. (Sofus Mortensen)
-
-\par Version 1 beta 16 (2002-2-12)
-\li Fixed bug in functors bstr::less, bstr::less_equal, bstr::greater, bstr::greater_equal, bstr::equal_to and bstr::not_equal_to. (Michael Geddes)
-\li tlb2h: switched ResolveAliases off per request from Michael Geddes.
-\li tlb2h: Removed dummy wrapper methods (see http://groups.yahoo.com/group/tlb2h/message/476). (Sofus Mortensen)
-
-\par Version 1 beta 15 (2002-2-1)
-\li Added lw_lock class based on Brad Wilson's LightweightLock (see http://www.quality.nu/dotnetguy/archive/fog0000000007.aspx). Many thanks to Brad for making LightweightLock open source. (Sofus Mortensen)
-\li Comet now works with MSVC7. (Sofus Mortensen)
-\li Removed functor.h. (Sofus Mortensen)
-\li Fixed serious bug in bstr_base - causing memory corruption when concat'ing bstr's. (Michael Geddes)
-\li Fixed obvious typo in locking_ptr. (Vladimir Voinkov)
-\li Removed unnecessary include dependency from scope_guard.h. (Vladimir Voinkov)
-\li Fixed compatibility problem with STLport for bstr comparison functors. (Michael Geddes)
-\li Removed level 4 warnings from currency.h. (Michael Geddes).
-\li Fixed problem with the -c option in tlb2h. (Michael Geddes).
-\li Fixed bug in ATL_module.h. (Michael Geddes)
-\li impl_dispatch is now lazy loading TypeInfo. Better performance for dual interfaces where client is not using IDispatch. (Sofus Mortensen)
-\li Fixed various bugs in tlb2h. (Sofus Mortensen)
-
-\par Version 1 beta 14 (2002-1-17)
-
-\li Fixed problem with dispinterfaces and [in, out] enum parameters. (Sofus Mortensen)
-\li Added simple system to prevent compiling out-of-date tlb2h generated headers. (Sofus Mortensen)
-\li Fixed bug in impl_dispatch. (Michael Geddes, Sofus Mortensen)
-
-\par Version 1 beta 13 take 4 (2002-1-11)
-
-\li Fixed problem with dispinterfaces and enum parameters reported by Kyle Alons. (Sofus Mortensen)
-\li Fixed serious bug in iterators for safearray_t reported by Steve Broeffle. The bug was caused by a MSVC compiler bug. (Sofus Mortensen)
-\li Fixed bug operator in operator[] in iterators for safearray_t. (Sofus Mortensen)
-
-\par Version 1 beta 13 take 3 (2002-1-9)
-
-\li Fixed bug in uuid_t introduced in beta 13 take 2. (Sofus Mortensen)
-
-\par Version 1 beta 13 take 2 (2002-1-7)
-
-\li Beta 13 couldn't compile with _UNICODE defined. Fixed now. (Sofus Mortensen)
-
-\par Version 1 beta 13 (2002-1-7)
-
-\li Added basic support for writing exe servers in Comet. (Mikael Lindgren, Sofus Mortensen)
-\li Added simple command line parser class to new header comet/cmd_line_parser.h (Mikael Lindgren)
-\li Added new header comet/tstring.h. Defines tstring, tistream, tostream, etc, etc. (Sofus Mortensen)
-\li Fixed various bugs in uuid_t. (Sofus Mortensen)
-
-\par Version 1 beta 12 (2001-12-20)
-
-\li Revision of embedded_object. embedded_object now takes parent type as first argument, arguments 2, 3, 4, .. denotes interfaces to implement.
- embedded_object_1 has been removed. embedded_object2 has been added, extends embedded_object with functionality to
- disconnect a child object from its parent. (Sofus Mortensen with help from Kyle Alons).
-\li Added new file dispatch.h with specialisation of wrap_t with similar (but superior) functionality as CComDispatchDriver.
-\li Added new class dynamic_dispatch to dispatch.h. Use dynamic_dispatch to dynamically implement IDispatch - adding methods and properties at runtime. (Sofus Mortensen)
-\li Changed interface of sink_impl so that unadvise no longer takes an argument. Additionally the destructor will unadvise if necessary. (Sofus Mortensen)
-\li Added new file uuid.h with GUID/UUID/CLSID wrapper called uuid_t. (Sofus Mortensen)
-\li Changed tlb2h to support new wrapper uuid_t. (Sofus Mortensen)
-\li Fixed potential thread safety problem regarding class factories. (Sofus Mortensen, Paul Hollingsworth)
-
-\par Version 1 beta 11 (2001-11-16)
-
-\li Major fix to tlb2h. tlb2h now supports properties in dispinterfaces. (Sofus Mortensen)
-\li Module constants are now static. (Sofus Mortensen)
-\li tlb2h now skips non-COM interfaces that do not derive (directly or transitively) from IUnknown. (Sofus Mortensen)
-\li Fixed problem with error messages ending up as garbage in tlb2h. (Kyle Alons)
-\li Various fixes regarding safearray_t. (Michael Geddes and Sofus Mortensen)
-\li Various other minor fixes. (Sofus Mortensen)
-
-\par Version 1 beta 10 (2001-10-17)
-
-\li class coclass changed so that the 3, 4, ... template parameters specifify additional interfaces to implement.
- Example:
- \code
- template<> coclass_implementation : public coclass
- \endcode
- (Sofus Mortensen)
-\li Aggregating another component is now done by adding class aggregates to the type list of interfaces. First template argument of class aggregates is the coclass
- to aggregating. The 2, 4, ... template arguments specify which interfaces to aggregate. If no interfaces have been specified, all interfaces will be aggregated.
- Example:
- \code
- template<> coclass_implementation : public coclass >
- \endcode
- (Sofus Mortensen)
-\li Added cmp method to bstr_base which a.o.t. can be configured for case insensitive comparision. (Michael Geddes)
-\li Added comparison functors based on cmp to bstr_base, less, less_equal, equal_to, etc. Example of usage:
- \code
- std::set > mySet;
- \endcode
- (Sofus Mortensen)
-\li Fixed bugs in assignment operators for datetime_t. (Sofus Mortensen, Mikael Lindgren)
-\li In ptr.h changed COMET_ALLOW_DECLSPEC_PROPERTY to COMET_USE_RAW_WRAPPERS. (Michael Geddes)
-\li In common.h added workaround for VARIANT_TRUE resulting in a level 4 warning. (Michael Geddes)
-\li Changed server.h, so that a compiler error will occur if there are unimplemented coclasses. In case you deliberately want
- unimplemented coclass define COMET_ALLOW_UNIMPLEMENTED_COCLASSES in std.h. (Sofus Mortensen)
-\li Added various helper functions to util.h. (Sofus Mortensen)
-\li Added support for aggregating the free threaded marshaler. Example:
- \code
- template<> coclass_implementation