added some development tools
[windows-sources.git] / developer / VSSDK / VisualStudioIntegration / Common / Source / CPP / VSL / MockInterfaces / VSLMockIVsStructuredFileIO.h
blobaa70020f1eb551ac977292e5993bd838e05b34fb
1 /***************************************************************************
3 Copyright (c) Microsoft Corporation. All rights reserved.
4 This code is licensed under the Visual Studio SDK license terms.
5 THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
6 ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
7 IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
8 PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
10 This code is a part of the Visual Studio Library.
12 ***************************************************************************/
14 #ifndef IVSSTRUCTUREDFILEIO_H_10C49CA1_2F46_11D3_A504_00C04F5E0BA5
15 #define IVSSTRUCTUREDFILEIO_H_10C49CA1_2F46_11D3_A504_00C04F5E0BA5
17 #if _MSC_VER > 1000
18 #pragma once
19 #endif
21 #include "vsshell.h"
23 #pragma warning(push)
24 #pragma warning(disable : 4510) // default constructor could not be generated
25 #pragma warning(disable : 4610) // can never be instantiated - user defined constructor required
26 #pragma warning(disable : 4512) // assignment operator could not be generated
27 #pragma warning(disable : 6011) // Dereferencing NULL pointer (a NULL derference is just another kind of failure for a unit test
29 namespace VSL
32 class IVsStructuredFileIONotImpl :
33 public IVsStructuredFileIO
36 VSL_DECLARE_NONINSTANTIABLE_BASE_CLASS(IVsStructuredFileIONotImpl)
38 public:
40 typedef IVsStructuredFileIO Interface;
42 STDMETHOD(CreateNew)(
43 /*[in]*/ LPCOLESTR /*szFileName*/,
44 /*[in]*/ ULONG /*nFormatIndex*/,
45 /*[in]*/ DWORD /*dwShareMode*/,
46 /*[in]*/ DWORD /*dwCreationDisposition*/,
47 /*[in]*/ DWORD /*dwFlagsAndAttributes*/,
48 /*[in]*/ IVsStructuredFileIOHelper* /*pIVsStructuredFileIOHelper*/,
49 /*[in]*/ LPCOLESTR /*szFormatVersion*/,
50 /*[in]*/ LPCOLESTR /*szDescription*/,
51 /*[out]*/ IVsPropertyFileOut** /*ppIVsPropertyFileOut*/)VSL_STDMETHOD_NOTIMPL
53 STDMETHOD(OpenExisting)(
54 /*[in]*/ LPCOLESTR /*szFileName*/,
55 /*[in]*/ DWORD /*dwShareMode*/,
56 /*[in]*/ DWORD /*dwCreationDisposition*/,
57 /*[in]*/ DWORD /*dwFlagsAndAttributes*/,
58 /*[in]*/ IVsStructuredFileIOHelper* /*pIVsStructuredFileIOHelper*/,
59 /*[out]*/ ULONG* /*pnFormatIndex*/,
60 /*[out]*/ IVsPropertyFileIn** /*ppIVsPropertyFileIn*/,
61 /*[out,optional]*/ BSTR* /*pbstrFormatVersion*/)VSL_STDMETHOD_NOTIMPL
63 STDMETHOD(GetFormatList)(
64 /*[in]*/ LPCOLESTR /*szEntityName*/,
65 /*[in]*/ LPCOLESTR /*szFileTypes*/,
66 /*[out]*/ LPOLESTR* /*ppszFormatList*/)VSL_STDMETHOD_NOTIMPL
68 STDMETHOD(GetFormatInfo)(
69 /*[in]*/ ULONG /*nFormatIndex*/,
70 /*[out,optional]*/ UINT* /*puiCodePage*/)VSL_STDMETHOD_NOTIMPL
72 STDMETHOD(FindFormatIndex)(
73 /*[in]*/ UINT /*uiCodePage*/,
74 /*[out,optional]*/ ULONG* /*pnFormatIndex*/)VSL_STDMETHOD_NOTIMPL
77 class IVsStructuredFileIOMockImpl :
78 public IVsStructuredFileIO,
79 public MockBase
82 VSL_DECLARE_NONINSTANTIABLE_BASE_CLASS(IVsStructuredFileIOMockImpl)
84 public:
86 VSL_DEFINE_MOCK_CLASS_TYPDEFS(IVsStructuredFileIOMockImpl)
88 typedef IVsStructuredFileIO Interface;
89 struct CreateNewValidValues
91 /*[in]*/ LPCOLESTR szFileName;
92 /*[in]*/ ULONG nFormatIndex;
93 /*[in]*/ DWORD dwShareMode;
94 /*[in]*/ DWORD dwCreationDisposition;
95 /*[in]*/ DWORD dwFlagsAndAttributes;
96 /*[in]*/ IVsStructuredFileIOHelper* pIVsStructuredFileIOHelper;
97 /*[in]*/ LPCOLESTR szFormatVersion;
98 /*[in]*/ LPCOLESTR szDescription;
99 /*[out]*/ IVsPropertyFileOut** ppIVsPropertyFileOut;
100 HRESULT retValue;
103 STDMETHOD(CreateNew)(
104 /*[in]*/ LPCOLESTR szFileName,
105 /*[in]*/ ULONG nFormatIndex,
106 /*[in]*/ DWORD dwShareMode,
107 /*[in]*/ DWORD dwCreationDisposition,
108 /*[in]*/ DWORD dwFlagsAndAttributes,
109 /*[in]*/ IVsStructuredFileIOHelper* pIVsStructuredFileIOHelper,
110 /*[in]*/ LPCOLESTR szFormatVersion,
111 /*[in]*/ LPCOLESTR szDescription,
112 /*[out]*/ IVsPropertyFileOut** ppIVsPropertyFileOut)
114 VSL_DEFINE_MOCK_METHOD(CreateNew)
116 VSL_CHECK_VALIDVALUE_STRINGW(szFileName);
118 VSL_CHECK_VALIDVALUE(nFormatIndex);
120 VSL_CHECK_VALIDVALUE(dwShareMode);
122 VSL_CHECK_VALIDVALUE(dwCreationDisposition);
124 VSL_CHECK_VALIDVALUE(dwFlagsAndAttributes);
126 VSL_CHECK_VALIDVALUE_INTERFACEPOINTER(pIVsStructuredFileIOHelper);
128 VSL_CHECK_VALIDVALUE_STRINGW(szFormatVersion);
130 VSL_CHECK_VALIDVALUE_STRINGW(szDescription);
132 VSL_SET_VALIDVALUE_INTERFACE(ppIVsPropertyFileOut);
134 VSL_RETURN_VALIDVALUES();
136 struct OpenExistingValidValues
138 /*[in]*/ LPCOLESTR szFileName;
139 /*[in]*/ DWORD dwShareMode;
140 /*[in]*/ DWORD dwCreationDisposition;
141 /*[in]*/ DWORD dwFlagsAndAttributes;
142 /*[in]*/ IVsStructuredFileIOHelper* pIVsStructuredFileIOHelper;
143 /*[out]*/ ULONG* pnFormatIndex;
144 /*[out]*/ IVsPropertyFileIn** ppIVsPropertyFileIn;
145 /*[out,optional]*/ BSTR* pbstrFormatVersion;
146 HRESULT retValue;
149 STDMETHOD(OpenExisting)(
150 /*[in]*/ LPCOLESTR szFileName,
151 /*[in]*/ DWORD dwShareMode,
152 /*[in]*/ DWORD dwCreationDisposition,
153 /*[in]*/ DWORD dwFlagsAndAttributes,
154 /*[in]*/ IVsStructuredFileIOHelper* pIVsStructuredFileIOHelper,
155 /*[out]*/ ULONG* pnFormatIndex,
156 /*[out]*/ IVsPropertyFileIn** ppIVsPropertyFileIn,
157 /*[out,optional]*/ BSTR* pbstrFormatVersion)
159 VSL_DEFINE_MOCK_METHOD(OpenExisting)
161 VSL_CHECK_VALIDVALUE_STRINGW(szFileName);
163 VSL_CHECK_VALIDVALUE(dwShareMode);
165 VSL_CHECK_VALIDVALUE(dwCreationDisposition);
167 VSL_CHECK_VALIDVALUE(dwFlagsAndAttributes);
169 VSL_CHECK_VALIDVALUE_INTERFACEPOINTER(pIVsStructuredFileIOHelper);
171 VSL_SET_VALIDVALUE(pnFormatIndex);
173 VSL_SET_VALIDVALUE_INTERFACE(ppIVsPropertyFileIn);
175 VSL_SET_VALIDVALUE_BSTR(pbstrFormatVersion);
177 VSL_RETURN_VALIDVALUES();
179 struct GetFormatListValidValues
181 /*[in]*/ LPCOLESTR szEntityName;
182 /*[in]*/ LPCOLESTR szFileTypes;
183 /*[out]*/ LPOLESTR* ppszFormatList;
184 HRESULT retValue;
187 STDMETHOD(GetFormatList)(
188 /*[in]*/ LPCOLESTR szEntityName,
189 /*[in]*/ LPCOLESTR szFileTypes,
190 /*[out]*/ LPOLESTR* ppszFormatList)
192 VSL_DEFINE_MOCK_METHOD(GetFormatList)
194 VSL_CHECK_VALIDVALUE_STRINGW(szEntityName);
196 VSL_CHECK_VALIDVALUE_STRINGW(szFileTypes);
198 VSL_SET_VALIDVALUE(ppszFormatList);
200 VSL_RETURN_VALIDVALUES();
202 struct GetFormatInfoValidValues
204 /*[in]*/ ULONG nFormatIndex;
205 /*[out,optional]*/ UINT* puiCodePage;
206 HRESULT retValue;
209 STDMETHOD(GetFormatInfo)(
210 /*[in]*/ ULONG nFormatIndex,
211 /*[out,optional]*/ UINT* puiCodePage)
213 VSL_DEFINE_MOCK_METHOD(GetFormatInfo)
215 VSL_CHECK_VALIDVALUE(nFormatIndex);
217 VSL_SET_VALIDVALUE(puiCodePage);
219 VSL_RETURN_VALIDVALUES();
221 struct FindFormatIndexValidValues
223 /*[in]*/ UINT uiCodePage;
224 /*[out,optional]*/ ULONG* pnFormatIndex;
225 HRESULT retValue;
228 STDMETHOD(FindFormatIndex)(
229 /*[in]*/ UINT uiCodePage,
230 /*[out,optional]*/ ULONG* pnFormatIndex)
232 VSL_DEFINE_MOCK_METHOD(FindFormatIndex)
234 VSL_CHECK_VALIDVALUE(uiCodePage);
236 VSL_SET_VALIDVALUE(pnFormatIndex);
238 VSL_RETURN_VALIDVALUES();
243 } // namespace VSL
245 #pragma warning(pop)
247 #endif // IVSSTRUCTUREDFILEIO_H_10C49CA1_2F46_11D3_A504_00C04F5E0BA5