Add Dirk Luetjen's ssphys libraries and command-line tool
[vss2svn.git] / ssphys / SSAPI / VSSItem.cpp
bloba4ae2bdfe3554c6870175a8ad2d090d92878798d
1 // VSSItem.cpp : Implementation of CVSSItem
2 #include "stdafx.h"
3 #include "SSAPI.h"
4 #include "VSSItem.h"
5 #include "VSSItems.h"
6 #include "VSSVersions.h"
8 /////////////////////////////////////////////////////////////////////////////
9 // CVSSItem
11 STDMETHODIMP CVSSItem::get_Spec (BSTR * pSpec)
13 if (pSpec == NULL)
14 return E_POINTER;
16 ATLASSERT (m_pSSItem);
17 *pSpec = _bstr_t (m_pSSItem->GetSpec().c_str ()).copy ();
19 return NO_ERROR;
21 STDMETHODIMP CVSSItem::get_Binary (VARIANT_BOOL * pbBinary)
23 if (pbBinary == NULL)
24 return E_POINTER;
26 ATLASSERT (m_pSSItem);
27 *pbBinary = _variant_t (m_pSSItem->GetBinary());
29 return NO_ERROR;
31 STDMETHODIMP CVSSItem::put_Binary (VARIANT_BOOL pbBinary)
33 return E_NOTIMPL;
35 STDMETHODIMP CVSSItem::get_Deleted (VARIANT_BOOL * pbDeleted)
37 if (pbDeleted == NULL)
38 return E_POINTER;
40 ATLASSERT (m_pSSItem);
41 *pbDeleted = _variant_t (m_pSSItem->GetDeleted());
43 return NO_ERROR;
45 STDMETHODIMP CVSSItem::put_Deleted (VARIANT_BOOL pbDeleted)
47 return E_NOTIMPL;
49 STDMETHODIMP CVSSItem::get_Type (INT * piType)
51 if (piType == NULL)
52 return E_POINTER;
54 ATLASSERT (m_pSSItem);
55 *piType = m_pSSItem->GetType() == SSITEM_FILE ? VSSITEM_FILE : VSSITEM_PROJECT;
57 return NO_ERROR;
59 STDMETHODIMP CVSSItem::get_LocalSpec (BSTR * pLocal)
61 if (pLocal == NULL)
62 return E_POINTER;
64 ATLASSERT (m_pSSItem);
65 *pLocal = _bstr_t (m_pSSItem->GetLocalSpec().c_str()).copy ();
67 return NO_ERROR;
69 STDMETHODIMP CVSSItem::put_LocalSpec (BSTR pLocal)
71 return E_NOTIMPL;
73 STDMETHODIMP CVSSItem::get_Name (BSTR * pName)
75 if (pName == NULL)
76 return E_POINTER;
78 ATLASSERT (m_pSSItem);
79 *pName = _bstr_t (m_pSSItem->GetName().c_str()).copy ();
81 return NO_ERROR;
83 STDMETHODIMP CVSSItem::put_Name (BSTR pName)
85 return E_NOTIMPL;
87 STDMETHODIMP CVSSItem::get_Parent (IVSSItem * * ppIParent)
89 if (ppIParent == NULL)
90 return E_POINTER;
92 return E_NOTIMPL;
94 STDMETHODIMP CVSSItem::get_VersionNumber (LONG * piVersion)
96 if (piVersion == NULL)
97 return E_POINTER;
99 ATLASSERT (m_pSSItem);
100 *piVersion = _variant_t (m_pSSItem->GetVersionNumber());
102 return NO_ERROR;
104 STDMETHODIMP CVSSItem::get_Items (VARIANT_BOOL IncludeDeleted, IVSSItems * * ppIItems)
106 if (ppIItems == NULL)
107 return E_POINTER;
109 ATLASSERT (m_pSSItem);
110 SSItems* pItems = m_pSSItem->GetItems (IncludeDeleted);
112 CComObject<CVSSItems>* pVssItems;
113 HRESULT hRes = CComObject<CVSSItems>::CreateInstance(&pVssItems);
114 if (FAILED(hRes))
115 return hRes;
117 pVssItems->AddRef();
118 pVssItems->Init (pItems);
120 *ppIItems = pVssItems;
122 return NO_ERROR;
124 STDMETHODIMP CVSSItem::Get (BSTR * Local, LONG iFlags)
126 if (Local == NULL)
127 return E_POINTER;
129 return E_NOTIMPL;
131 STDMETHODIMP CVSSItem::Checkout (BSTR Comment, BSTR Local, LONG iFlags)
133 return E_NOTIMPL;
135 STDMETHODIMP CVSSItem::Checkin (BSTR Comment, BSTR Local, LONG iFlags)
137 return E_NOTIMPL;
139 STDMETHODIMP CVSSItem::UndoCheckout (BSTR Local, LONG iFlags)
141 return E_NOTIMPL;
143 STDMETHODIMP CVSSItem::get_IsCheckedOut (LONG * piStatus)
145 if (piStatus == NULL)
146 return E_POINTER;
148 ATLASSERT (m_pSSItem);
149 *piStatus = _variant_t (m_pSSItem->GetIsCheckedOut());
151 return NO_ERROR;
153 STDMETHODIMP CVSSItem::get_Checkouts (IVSSCheckouts * * ppICheckouts)
155 if (ppICheckouts == NULL)
156 return E_POINTER;
158 return E_NOTIMPL;
160 STDMETHODIMP CVSSItem::get_IsDifferent (BSTR Local, VARIANT_BOOL * pbDifferent)
162 if (pbDifferent == NULL)
163 return E_POINTER;
165 return E_NOTIMPL;
167 STDMETHODIMP CVSSItem::Add (BSTR Local, BSTR Comment, LONG iFlags, IVSSItem * * ppIItem)
169 if (ppIItem == NULL)
170 return E_POINTER;
172 return E_NOTIMPL;
174 STDMETHODIMP CVSSItem::NewSubproject (BSTR Name, BSTR Comment, IVSSItem * * ppIItem)
176 if (ppIItem == NULL)
177 return E_POINTER;
179 return E_NOTIMPL;
181 STDMETHODIMP CVSSItem::Share (IVSSItem * pIItem, BSTR Comment, LONG iFlags)
183 return E_NOTIMPL;
185 STDMETHODIMP CVSSItem::Destroy ()
187 return E_NOTIMPL;
189 STDMETHODIMP CVSSItem::Move (IVSSItem * pINewParent)
191 return E_NOTIMPL;
193 STDMETHODIMP CVSSItem::Label (BSTR Label, BSTR Comment)
195 return E_NOTIMPL;
197 STDMETHODIMP CVSSItem::get_Versions (LONG iFlags, IVSSVersions * * pIVersions)
199 if (pIVersions == NULL)
200 return E_POINTER;
202 CComObject<CVSSVersions>* pVssVersions;
203 HRESULT hRes = CComObject<CVSSVersions>::CreateInstance(&pVssVersions);
204 if (FAILED(hRes))
205 return hRes;
207 pVssVersions->AddRef();
209 *pIVersions = pVssVersions;
211 return NO_ERROR;
213 STDMETHODIMP CVSSItem::get_Version (VARIANT Version, IVSSItem * * ppIItem)
215 if (ppIItem == NULL)
216 return E_POINTER;
218 return E_NOTIMPL;
220 // IVSSItem
221 STDMETHODIMP CVSSItem::get_Links (IVSSItems * * ppIItems)
223 if (ppIItems == NULL)
224 return E_POINTER;
226 return E_NOTIMPL;
228 STDMETHODIMP CVSSItem::Branch (BSTR Comment, LONG iFlags, IVSSItem * * ppIItem)
230 if (ppIItem == NULL)
231 return E_POINTER;
233 return E_NOTIMPL;