Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/plugin/COM_Value.cpp

Issue 6650591174459392: Issues #276, #1163 - introduce class IncomingParam (Closed)
Patch Set: Created July 25, 2014, 11:27 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /** 1 /**
2 * \file COM_Value.cpp Support for the values used in COM and Automation. 2 * \file COM_Value.cpp Support for the values used in COM and Automation.
3 */ 3 */
4 #include "COM_Value.h" 4 #include "COM_Value.h"
5 #include <stdexcept> 5 #include <stdexcept>
6 6
7 using namespace AdblockPlus::COM; 7 using namespace AdblockPlus::COM;
8 8
9 /* 9 /*
10 * MSDN SysAllocStringLen function http://msdn.microsoft.com/en-us/library/windo ws/desktop/ms221639%28v=vs.85%29.aspx 10 * MSDN SysAllocStringLen function http://msdn.microsoft.com/en-us/library/windo ws/desktop/ms221639%28v=vs.85%29.aspx
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 BSTR_Argument::operator std::wstring() const 57 BSTR_Argument::operator std::wstring() const
58 { 58 {
59 if ( !bstr ) 59 if ( !bstr )
60 { 60 {
61 return std::wstring(); 61 return std::wstring();
62 } 62 }
63 return std::wstring( bstr, SysStringLen( bstr ) ); 63 return std::wstring( bstr, SysStringLen( bstr ) );
64 } 64 }
65
66
67 namespace
68 {
69 /**
70 * Pre-construction assistant for wstring_Incoming_Param.
71 *
72 * Because wstring_Incoming_Param is a derived class,
73 * we need to have a wstring value to initialize the base class.
74 */
75 std::wstring construct_Incoming_Param( BSTR b )
76 {
77 if ( !b )
78 {
79 return std::wstring();
80 }
81 return std::wstring( b, SysStringLen( b ) );
82 }
83 }
84
85 Incoming_Param::Incoming_Param( BSTR b )
86 : std::wstring( construct_Incoming_Param( b ) )
87 {
88 }
OLDNEW

Powered by Google App Engine
This is Rietveld