• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision455139b3ba32caef11606da1ad2539ca3bb54d17 (tree)
Zeit2012-03-30 01:40:45
Autorqwerty2501 <qwerty2501@user...>
Commiterqwerty2501

Log Message

ニコ生api実装途中

Ändern Zusammenfassung

Diff

Binary files a/nlite.suo and b/nlite.suo differ
--- a/nlite_common/bugreport.cpp
+++ b/nlite_common/bugreport.cpp
@@ -30,9 +30,9 @@ Bool BugTransfer::Report()const{
3030 NString message(std::regex_replace(bugmessage.str(),reg,NString(_T(""))));
3131
3232 CWinHttpClient httpClient;
33- httpClient->Open(_T("POST"),_T("http://nlite.sourceforge.jp/cgi-bin/bugreport.rb"));
34- httpClient->SetRequestHeader(_T("Content-Type"),_T("application/x-www-form-urlencoded"));
35- httpClient->Send(message.c_str());
33+ httpClient.Open(_T("POST"),_T("http://nlite.sourceforge.jp/cgi-bin/bugreport.rb"));
34+ httpClient.SetRequestHeader(_T("Content-Type"),_T("application/x-www-form-urlencoded"));
35+ httpClient.Send(message.c_str());
3636 return rslt;
3737 }
3838
--- a/nlite_common/http.cpp
+++ b/nlite_common/http.cpp
@@ -1,11 +1,55 @@
11 #include "stdafx.h"
2+#include "define.h"
23 #include "http.h"
34
45 #include "namespace_start.h"
56 CWinHttpClient::CWinHttpClient(){
67
7- this->CreateInstance(WinHttp::CLSID_WinHttpRequest);
8+ m_ptr.CreateInstance(WinHttp::CLSID_WinHttpRequest);
89
910 }
1011
12+CHResult CWinHttpClient::Open(const NString &method,const NString &url,const _variant_t &async){
13+
14+ return m_ptr->Open(method.c_str(),url.c_str(),async);
15+
16+}
17+
18+
19+CHResult CWinHttpClient::get_Response(IStream **ppStream){
20+ CComVariant var;
21+ CHResult result = m_ptr->get_ResponseStream(&var);
22+
23+
24+ if(result.IsSucceded()&& (VT_UNKNOWN == V_VT(&var) || VT_STREAM == V_VT(&var))){
25+
26+ result = V_UNKNOWN(&var)->QueryInterface(IID_IStream,reinterpret_cast<Void**>(ppStream));
27+
28+
29+ }
30+
31+ return result;
32+}
33+
34+CHResult CWinHttpClient::SetRequestHeader(const NString &headerName,const NString &headerBody){
35+
36+ return m_ptr->SetRequestHeader(headerName.c_str(),headerBody.c_str());
37+}
38+
39+CHResult CWinHttpClient::SetRequestHeader(const cookie::CCookie &val){
40+
41+ nstringstream ss;
42+
43+ ss << val.GetName();
44+ ss << _T("=");
45+ ss << val.GetCookieValue();
46+
47+ return m_ptr->SetRequestHeader(_T("Cookie"),ss.str().c_str());
48+
49+}
50+
51+CHResult CWinHttpClient::Send(const _variant_t &value){
52+
53+ return m_ptr->Send(value);
54+}
1155 #include "namespace_end.h"
\ No newline at end of file
--- a/nlite_common/http.h
+++ b/nlite_common/http.h
@@ -1,12 +1,77 @@
11 #pragma once
2+#include "commanage.h"
3+#include "windowsAPI.h"
4+#include "xmlReader.h"
5+#include <nlite_cookie\cookie.h>
26 #import "winhttp.dll" named_guids
37
48
59 #include "namespace_start.h"
6-class CWinHttpClient:public WinHttp::IWinHttpRequestPtr{
7-
10+class CWinHttpClient {
11+private:
12+ CComManage m_com;
13+ WinHttp::IWinHttpRequestPtr m_ptr;
814 public:
15+
16+ ///
17+ ///URLオープン
18+ ///
19+ CHResult Open(const NString &method,const NString &url,const _variant_t &async = vtMissing);
20+
21+
22+ ///
23+ ///レスポンスからIStreamを取得
24+ ///
25+ CHResult get_Response(IStream **ppStream);
26+
27+ ///
28+ ///ヘッダセット
29+ ///
30+ CHResult SetRequestHeader(const NString &headerName,const NString &headerBody);
31+
32+ CHResult SetRequestHeader(const cookie::CCookie &val);
33+
34+ ///
35+ ///データ送信
36+ ///
37+ CHResult Send(const _variant_t &value = vtMissing);
38+
939 CWinHttpClient();
1040
41+
42+
43+ //
44+ //テンプレート関数
45+ //
46+ template<typename F>
47+ CHResult get_ResponseXml(F func){
48+
49+ CComPtr<IStream> pStream;
50+ CHResult result = this->get_Response(&pStream);
51+
52+ if(result.IsSucceded()){
53+
54+ CXmlReader xmlReader;
55+
56+ result = xmlReader.Create();
57+
58+ if(result.IsSucceded()){
59+
60+ result = xmlReader.SetInput(pStream);
61+
62+ if(result.IsSucceded()){
63+
64+ result = func(xmlReader);
65+ }
66+ }
67+
68+ }
69+
70+
71+ return result;
72+ }
73+
74+
75+
1176 };
1277 #include "namespace_end.h"
\ No newline at end of file
--- /dev/null
+++ b/nlite_common/macro.h
@@ -0,0 +1,10 @@
1+#pragma once
2+
3+
4+#define ASSERT(e) assert(e)
5+
6+#ifdef NDEBUG
7+#define VERIFY(expression) expression
8+#else // #ifdef NDEBUG
9+#define VERIFY(expression) assert( 0 != (expression) )
10+#endif // #ifdef NDEBUG
\ No newline at end of file
--- a/nlite_common/nlite_common.vcxproj
+++ b/nlite_common/nlite_common.vcxproj
@@ -108,6 +108,7 @@
108108 <ClInclude Include="define.h" />
109109 <ClInclude Include="function.h" />
110110 <ClInclude Include="http.h" />
111+ <ClInclude Include="macro.h" />
111112 <ClInclude Include="namespace_end.h" />
112113 <ClInclude Include="namespace_start.h" />
113114 <ClInclude Include="nexception.h" />
@@ -118,6 +119,8 @@
118119 <ClInclude Include="unit_test.h" />
119120 <ClInclude Include="use_namespace.h" />
120121 <ClInclude Include="windowsAPI.h" />
122+ <ClInclude Include="winhttphandle.h" />
123+ <ClInclude Include="xmlReader.h" />
121124 </ItemGroup>
122125 <ItemGroup>
123126 <ClCompile Include="appInfo.cpp" />
@@ -133,6 +136,8 @@
133136 </ClCompile>
134137 <ClCompile Include="unit_test.cpp" />
135138 <ClCompile Include="windowsAPI.cpp" />
139+ <ClCompile Include="winhttphandle.cpp" />
140+ <ClCompile Include="xmlreader.cpp" />
136141 </ItemGroup>
137142 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
138143 <ImportGroup Label="ExtensionTargets">
--- a/nlite_common/nlite_common.vcxproj.filters
+++ b/nlite_common/nlite_common.vcxproj.filters
@@ -66,6 +66,15 @@
6666 <ClInclude Include="commanage.h">
6767 <Filter>ヘッダー ファイル</Filter>
6868 </ClInclude>
69+ <ClInclude Include="macro.h">
70+ <Filter>ヘッダー ファイル</Filter>
71+ </ClInclude>
72+ <ClInclude Include="winhttphandle.h">
73+ <Filter>ヘッダー ファイル</Filter>
74+ </ClInclude>
75+ <ClInclude Include="xmlReader.h">
76+ <Filter>ヘッダー ファイル</Filter>
77+ </ClInclude>
6978 </ItemGroup>
7079 <ItemGroup>
7180 <ClCompile Include="stdafx.cpp">
@@ -95,5 +104,11 @@
95104 <ClCompile Include="function.cpp">
96105 <Filter>ソース ファイル</Filter>
97106 </ClCompile>
107+ <ClCompile Include="winhttphandle.cpp">
108+ <Filter>ソース ファイル</Filter>
109+ </ClCompile>
110+ <ClCompile Include="xmlreader.cpp">
111+ <Filter>ソース ファイル</Filter>
112+ </ClCompile>
98113 </ItemGroup>
99114 </Project>
\ No newline at end of file
--- a/nlite_common/stdafx.h
+++ b/nlite_common/stdafx.h
@@ -14,7 +14,7 @@
1414 #include <Shlobj.h>
1515 #include <Shlwapi.h>
1616 #include <Iphlpapi.h>
17-// TODO: プログラムに必要な追加ヘッダーをここで参照してください。
17+
1818 #include <iostream>
1919 #include <string>
2020 #include <tchar.h>
@@ -26,4 +26,7 @@
2626 #include <boost\test\unit_test.hpp>
2727 #include <boost\lexical_cast.hpp>
2828 #include <boost\utility.hpp>
29-#include <stdexcept>
\ No newline at end of file
29+#include <stdexcept>
30+#include <atlmem.h>
31+#include <atlbase.h>
32+#include <xmllite.h>
\ No newline at end of file
--- a/nlite_common/windowsAPI.cpp
+++ b/nlite_common/windowsAPI.cpp
@@ -270,22 +270,27 @@ HRESULT CHResult::operator=(HRESULT hResult){
270270
271271 }
272272
273-CHResult::operator HRESULT(){
273+CHResult::operator HRESULT()const{
274274
275275 return this->m_hResult;
276276 }
277277
278-Bool CHResult::IsS_OK(){
278+Bool CHResult::IsS_OK()const{
279279
280280 return m_hResult == S_OK;
281281
282282 }
283283
284-Bool CHResult::IsSucceded(){
284+Bool CHResult::IsSucceded()const{
285285
286286 return SUCCEEDED(m_hResult);
287287 }
288288
289+Bool CHResult::IsFailed()const{
290+
291+ return FAILED(m_hResult);
292+}
293+
289294
290295 Bool operator==(const CHResult &result,HRESULT hResult){
291296
@@ -383,7 +388,7 @@ Void GetWindowsErrorMessage(NString &buf,DWORD lastErrorCode){
383388 NString rslt;
384389 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, lastErrorCode,MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf,0,(va_list*)NULL);
385390
386- buf = lpMsgBuf;
391+ buf = lpMsgBuf != nullptr ? lpMsgBuf: _T("");
387392 LocalFree(lpMsgBuf);
388393
389394 return;
--- a/nlite_common/windowsAPI.h
+++ b/nlite_common/windowsAPI.h
@@ -1,6 +1,7 @@
11 #pragma once
22
33 #include <Windows.h>
4+
45 #include "unit_test.h"
56 #include "define.h"
67 #include "raii.h"
@@ -26,11 +27,13 @@ public:
2627
2728 HRESULT operator=(HRESULT hResult);
2829
29- operator HRESULT();
30+ operator HRESULT()const;
31+
32+ Bool IsS_OK()const;
3033
31- Bool IsS_OK();
34+ Bool IsSucceded()const;
3235
33- Bool IsSucceded();
36+ Bool IsFailed()const;
3437
3538
3639
--- /dev/null
+++ b/nlite_common/winhttphandle.cpp
@@ -0,0 +1,112 @@
1+
2+#include "stdafx.h"
3+#include "winhttphandle.h"
4+#include "macro.h"
5+
6+
7+/*
8+#include "namespace_start.h"
9+
10+
11+//
12+//ハンドル管理
13+//
14+WinHttpHandle::WinHttpHandle() :
15+ m_handle(0)
16+ {}
17+
18+WinHttpHandle::~WinHttpHandle()
19+ {
20+ Close();
21+ }
22+
23+
24+ Bool WinHttpHandle::Attach(HINTERNET handle)
25+ {
26+ ASSERT(0 == m_handle);
27+ m_handle = handle;
28+ return 0 != m_handle;
29+ }
30+
31+ HINTERNET WinHttpHandle::Detach()
32+ {
33+ HANDLE handle = m_handle;
34+ m_handle = 0;
35+ return handle;
36+ }
37+
38+ Void WinHttpHandle::Close()
39+ {
40+ if (0 != m_handle)
41+ {
42+ VERIFY(::WinHttpCloseHandle(m_handle));
43+ m_handle = 0;
44+ }
45+ }
46+
47+
48+ CHResult WinHttpHandle::SetOption(DWORD option,const Void* value,DWORD length)
49+ {
50+ if (!::WinHttpSetOption(m_handle,
51+ option,
52+ const_cast<void*>(value),
53+ length))
54+ {
55+ return HRESULT_FROM_WIN32(::GetLastError());
56+ }
57+
58+ return S_OK;
59+ }
60+
61+ CHResult WinHttpHandle::QueryOption(DWORD option,Void* value,DWORD& length) const
62+ {
63+ if (!::WinHttpQueryOption(m_handle,
64+ option,
65+ value,
66+ &length))
67+ {
68+ return HRESULT_FROM_WIN32(::GetLastError());
69+ }
70+
71+ return S_OK;
72+ }
73+
74+
75+//
76+//セッション管理
77+//
78+CHResult WinHttpSession::Initialize()
79+{
80+ if (!Attach(::WinHttpOpen(0, // no agent string
81+ WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,
82+ WINHTTP_NO_PROXY_NAME,
83+ WINHTTP_NO_PROXY_BYPASS,
84+ WINHTTP_FLAG_ASYNC)))
85+ {
86+ return HRESULT_FROM_WIN32(::GetLastError());
87+ }
88+
89+ return S_OK;
90+}
91+
92+//
93+//接続管理
94+//
95+CHResult WinHttpConnection::Initialize(PCWSTR serverName,INTERNET_PORT portNumber,const WinHttpSession& session)
96+ {
97+ if (!Attach(::WinHttpConnect(session.m_handle,
98+ serverName,
99+ portNumber,
100+ 0))) // reserved
101+ {
102+ return HRESULT_FROM_WIN32(::GetLastError());
103+ }
104+
105+ return S_OK;
106+ }
107+
108+
109+
110+
111+#include "namespace_end.h"
112+ */
\ No newline at end of file
--- /dev/null
+++ b/nlite_common/winhttphandle.h
@@ -0,0 +1,117 @@
1+#pragma once
2+
3+/*
4+#include <winhttp.h>
5+#include <atlmem.h>
6+#include <boost\noncopyable.hpp>
7+#include "define.h"
8+#include "windowsAPI.h"
9+
10+
11+#include "namespace_start.h"
12+
13+
14+
15+///
16+///ハンドル管理
17+///
18+class WinHttpHandle:public boost::noncopyable
19+{
20+public:
21+ WinHttpHandle();
22+
23+ ~WinHttpHandle();
24+
25+ Bool Attach(HINTERNET handle);
26+
27+ HINTERNET Detach();
28+
29+ Void Close();
30+
31+ CHResult SetOption(DWORD option,const Void* value,DWORD length);
32+
33+ CHResult QueryOption(DWORD option,Void* value,DWORD& length) const;
34+
35+
36+
37+ HINTERNET m_handle;
38+};
39+
40+
41+///
42+///セッション管理
43+///
44+class WinHttpSession : public WinHttpHandle
45+{
46+public:
47+ CHResult Initialize();
48+
49+};
50+
51+
52+class WinHttpConnection : public WinHttpHandle
53+{
54+public:
55+ CHResult Initialize(PCWSTR serverName,INTERNET_PORT portNumber,const WinHttpSession& session);
56+
57+};
58+
59+
60+//template <typename T>
61+class WinHttpRequest : public WinHttpHandle
62+{
63+public:
64+ CHResult Initialize(PCWSTR path,
65+ __in_opt PCWSTR verb,
66+ const WinHttpConnection& connection)
67+ {
68+ m_buffer.Allocate(8 * 1024);
69+
70+ WinHttpOpenRequest(connection.m_handle,verb,
71+ // Call WinHttpOpenRequest and WinHttpSetStatusCallback.
72+ }
73+
74+ CHResult SendRequest(__in_opt PCWSTR headers,
75+ DWORD headersLength,
76+ __in_opt const void* optional,
77+ DWORD optionalLength,
78+ DWORD totalLength)
79+ {
80+ T* pT = static_cast<T*>(this);
81+
82+ // Call WinHttpSendRequest with pT as the context value.
83+ }
84+
85+protected:
86+ static void CALLBACK Callback(HINTERNET handle,
87+ DWORD_PTR context,
88+ DWORD code,
89+ void* info,
90+ DWORD length)
91+ {
92+ if (0 != context)
93+ {
94+ T* pT = reinterpret_cast<T*>(context);
95+
96+ HRESULT result = pT->OnCallback(code,
97+ info,
98+ length);
99+
100+ if (FAILED(result))
101+ {
102+ pT->OnResponseComplete(result);
103+ }
104+ }
105+ }
106+
107+ CHResult OnCallback(DWORD code,
108+ const void* info,
109+ DWORD length)
110+ {
111+ // Handle notifications here.
112+ }
113+
114+ CGlobalHeap m_buffer;
115+};
116+#include "namespace_end.h"
117+*/
\ No newline at end of file
--- /dev/null
+++ b/nlite_common/xmlReader.cpp
@@ -0,0 +1,40 @@
1+#include "stdafx.h"
2+#include "xmlReader.h"
3+
4+#include "namespace_start.h"
5+
6+
7+CHResult CXmlReader::Create(REFIID riid,IMalloc *pMalloc){
8+
9+ return CreateXmlReader(riid,reinterpret_cast<Void**>(&m_xmlReader),pMalloc);
10+
11+}
12+
13+
14+CHResult CXmlReader::SetInput(IStream *pStream){
15+
16+ return m_xmlReader->SetInput(pStream);
17+}
18+
19+
20+CHResult CXmlReader::Read(XmlNodeType *pXmlNodeType){
21+
22+
23+ return m_xmlReader->Read(pXmlNodeType);
24+}
25+
26+CHResult CXmlReader::GetLocalName(const NChar **ppLocalName,UInt *pLocalNameLen){
27+
28+ return m_xmlReader->GetLocalName(ppLocalName,pLocalNameLen);
29+}
30+
31+CHResult CXmlReader::GetValue(const NChar **ppValue,UInt *pValueLen = nullptr){
32+
33+ return m_xmlReader->GetValue(ppValue,pValueLen);
34+}
35+CHResult CXmlReader::MoveToFirstAttribute(){
36+
37+ return m_xmlReader->MoveToFirstAttribute();
38+}
39+
40+#include "namespace_end.h"
\ No newline at end of file
--- /dev/null
+++ b/nlite_common/xmlReader.h
@@ -0,0 +1,33 @@
1+#pragma once
2+
3+#include <atlbase.h>
4+#include <xmllite.h>
5+#include "windowsAPI.h"
6+
7+#include "namespace_start.h"
8+
9+
10+class CXmlReader{
11+
12+private:
13+ CComPtr<IXmlReader> m_xmlReader;
14+
15+public:
16+ CHResult Create(REFIID riid = __uuidof(IXmlReader),IMalloc *pMalloc = nullptr);
17+
18+ CHResult SetInput(IStream *pStream);
19+
20+ CHResult Read(XmlNodeType *pXmlNodeType);
21+
22+
23+ CHResult GetLocalName(const NChar **ppLocalName,UInt *pLocalNameLen = nullptr);
24+
25+ CHResult GetValue(const NChar **ppValue,UInt *pValueLen = nullptr);
26+
27+ CHResult MoveToFirstAttribute();
28+
29+};
30+
31+
32+
33+#include "namespace_end.h"
\ No newline at end of file
--- a/nlite_cookie/cookie.h
+++ b/nlite_cookie/cookie.h
@@ -1,5 +1,6 @@
11 #pragma once
22
3+#include <deque>
34
45 #include <nlite_common\define.h>
56
@@ -37,4 +38,10 @@ public:
3738
3839 };
3940
41+
42+///
43+///クッキーリスト定義
44+///
45+typedef std::deque<CCookie> CookieList;
46+
4047 #include "namespace_end.h"
\ No newline at end of file
--- a/nlite_cookie/cookieGetResult.cpp
+++ b/nlite_cookie/cookieGetResult.cpp
@@ -51,7 +51,9 @@ winerr:
5151
5252 bug.windowsErrorCode = boost::lexical_cast<NString>(this->GetExtendCode().hResult);
5353 GetWindowsErrorMessage(winerrStr,this->GetExtendCode().hResult);
54- bug.windowsErrorMessage = winerrStr;
54+ if(!winerrStr.empty()){
55+ bug.windowsErrorMessage = winerrStr;
56+ }
5557 }
5658 break;
5759
--- a/nlite_cookie/stdafx.h
+++ b/nlite_cookie/stdafx.h
@@ -20,3 +20,4 @@
2020 #include <boost\lexical_cast.hpp>
2121 #include <boost\thread.hpp>
2222 #include <atlfile.h>
23+#include <deque>
\ No newline at end of file
--- a/nlite_cookie/unit_test.cpp
+++ b/nlite_cookie/unit_test.cpp
@@ -299,12 +299,11 @@ Void UnitTest(){
299299 CookieManageTest(browsertype::OPERA);
300300 CookieManageTest(browsertype::SAFARI);
301301
302-
303302 /*
304303 CCookieGetResult rslt(browsertype::UNDEFINED);
305304
306- rslt.SetResultCode(resultcode::ERR_SQLITE);
307- rslt.SetSQLiteResult(-1);
305+ rslt.SetResultCode(resultcode::ERR_IEAPI_SEC);
306+ rslt.SetHResult(-1);
308307 rslt.Report();
309308 */
310309 return;
--- /dev/null
+++ b/nlite_nicoapi/auth.cpp
@@ -0,0 +1,21 @@
1+#include "stdafx.h"
2+#include "define.h"
3+#include "auth.h"
4+
5+#include "namespace_start.h"
6+
7+Void CAuth::SetUserSession(cookie::CCookie &val){
8+
9+ this->user_session = val;
10+}
11+
12+const cookie::CCookie &CAuth::GetUserSession()const{
13+
14+ return this->user_session;
15+}
16+
17+
18+
19+
20+
21+#include "namespace_end.h"
\ No newline at end of file
--- /dev/null
+++ b/nlite_nicoapi/auth.h
@@ -0,0 +1,26 @@
1+#pragma once
2+
3+#include <nlite_cookie\cookie.h>
4+#include "define.h"
5+
6+#include "namespace_start.h"
7+
8+
9+///
10+///ニコニコ動画認証クラス
11+///
12+class CAuth{
13+
14+private:
15+ cookie::CCookie user_session;
16+
17+public:
18+ Void SetUserSession(cookie::CCookie &val);
19+
20+ const cookie::CCookie &GetUserSession()const;
21+
22+};
23+
24+
25+
26+#include "namespace_end.h"
\ No newline at end of file
--- /dev/null
+++ b/nlite_nicoapi/define.h
@@ -0,0 +1,4 @@
1+#pragma once
2+
3+
4+#include <nlite_common\define.h>
\ No newline at end of file
--- /dev/null
+++ b/nlite_nicoapi/namespace_end.h
@@ -0,0 +1,2 @@
1+#include <nlite_common\namespace_end.h>
2+}
\ No newline at end of file
--- /dev/null
+++ b/nlite_nicoapi/namespace_start.h
@@ -0,0 +1,2 @@
1+#include <nlite_common\namespace_start.h>
2+namespace nicoapi{
\ No newline at end of file
--- a/nlite_nicoapi/nlite_nicoapi.vcxproj
+++ b/nlite_nicoapi/nlite_nicoapi.vcxproj
@@ -102,15 +102,22 @@
102102 <None Include="ReadMe.txt" />
103103 </ItemGroup>
104104 <ItemGroup>
105+ <ClInclude Include="auth.h" />
106+ <ClInclude Include="define.h" />
107+ <ClInclude Include="namespace_end.h" />
108+ <ClInclude Include="namespace_start.h" />
105109 <ClInclude Include="stdafx.h" />
106110 <ClInclude Include="targetver.h" />
111+ <ClInclude Include="unit_test.h" />
107112 </ItemGroup>
108113 <ItemGroup>
114+ <ClCompile Include="auth.cpp" />
109115 <ClCompile Include="stdafx.cpp">
110116 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
111117 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='UnitTest|Win32'">Create</PrecompiledHeader>
112118 <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
113119 </ClCompile>
120+ <ClCompile Include="unit_test.cpp" />
114121 </ItemGroup>
115122 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
116123 <ImportGroup Label="ExtensionTargets">
--- a/nlite_nicoapi/nlite_nicoapi.vcxproj.filters
+++ b/nlite_nicoapi/nlite_nicoapi.vcxproj.filters
@@ -24,10 +24,31 @@
2424 <ClInclude Include="targetver.h">
2525 <Filter>ヘッダー ファイル</Filter>
2626 </ClInclude>
27+ <ClInclude Include="namespace_start.h">
28+ <Filter>ヘッダー ファイル</Filter>
29+ </ClInclude>
30+ <ClInclude Include="namespace_end.h">
31+ <Filter>ヘッダー ファイル</Filter>
32+ </ClInclude>
33+ <ClInclude Include="unit_test.h">
34+ <Filter>ヘッダー ファイル</Filter>
35+ </ClInclude>
36+ <ClInclude Include="define.h">
37+ <Filter>ヘッダー ファイル</Filter>
38+ </ClInclude>
39+ <ClInclude Include="auth.h">
40+ <Filter>ヘッダー ファイル</Filter>
41+ </ClInclude>
2742 </ItemGroup>
2843 <ItemGroup>
2944 <ClCompile Include="stdafx.cpp">
3045 <Filter>ソース ファイル</Filter>
3146 </ClCompile>
47+ <ClCompile Include="unit_test.cpp">
48+ <Filter>ソース ファイル</Filter>
49+ </ClCompile>
50+ <ClCompile Include="auth.cpp">
51+ <Filter>ソース ファイル</Filter>
52+ </ClCompile>
3253 </ItemGroup>
3354 </Project>
\ No newline at end of file
--- /dev/null
+++ b/nlite_nicoapi/unit_test.cpp
@@ -0,0 +1,12 @@
1+#include "stdafx.h"
2+#include "define.h"
3+#include "unit_test.h"
4+
5+#include "namespace_start.h"
6+Void UnitTest(){
7+
8+
9+
10+
11+}
12+#include "namespace_end.h"
\ No newline at end of file
--- /dev/null
+++ b/nlite_nicoapi/unit_test.h
@@ -0,0 +1,5 @@
1+#include "namespace_start.h"
2+
3+#include <nlite_test\unit_test.h>
4+
5+#include "namespace_end.h"
\ No newline at end of file
--- /dev/null
+++ b/nlite_test/nicoapitest.h
@@ -0,0 +1,33 @@
1+#pragma once
2+
3+
4+
5+#include <boost\test\unit_test.hpp>
6+#include <nlite_nicoapi\unit_test.h>
7+
8+
9+
10+
11+
12+BOOST_AUTO_TEST_SUITE(nicoapi_test_suite)
13+
14+ BOOST_AUTO_TEST_CASE(init_nlite_test_cookie){
15+
16+
17+
18+ }
19+
20+ BOOST_AUTO_TEST_CASE(unit_test_nicoapi){
21+
22+
23+ nicoapi::UnitTest();
24+
25+ }
26+
27+
28+ BOOST_AUTO_TEST_CASE(finalize_test_nicoapi){
29+
30+
31+ }
32+
33+BOOST_AUTO_TEST_SUITE_END()
\ No newline at end of file
--- a/nlite_test/nlite_test.cpp
+++ b/nlite_test/nlite_test.cpp
@@ -9,6 +9,7 @@
99
1010 #define BOOST_TEST_MODULE SimpleTest
1111
12+#include "nicoapitest.h"
1213 #include "commontest.h"
1314 #include "cookietest.h"
1415
@@ -21,7 +22,6 @@ BOOST_AUTO_TEST_SUITE(end_test_suite)
2122
2223
2324
24-
2525 std::string s;
2626
2727 do{
@@ -37,3 +37,4 @@ BOOST_AUTO_TEST_SUITE_END()
3737
3838 #pragma comment(lib,"nlite_common.lib")
3939 #pragma comment(lib,"nlite_cookie.lib")
40+#pragma comment(lib,"nlite_nicoapi.lib")
\ No newline at end of file
--- a/nlite_test/nlite_test.vcxproj
+++ b/nlite_test/nlite_test.vcxproj
@@ -115,6 +115,7 @@
115115 <ItemGroup>
116116 <ClInclude Include="commontest.h" />
117117 <ClInclude Include="cookietest.h" />
118+ <ClInclude Include="nicoapitest.h" />
118119 <ClInclude Include="stdafx.h" />
119120 <ClInclude Include="targetver.h" />
120121 <ClInclude Include="unit_test.h" />
--- a/nlite_test/nlite_test.vcxproj.filters
+++ b/nlite_test/nlite_test.vcxproj.filters
@@ -39,6 +39,9 @@
3939 <ClInclude Include="cookietest.h">
4040 <Filter>ヘッダー ファイル</Filter>
4141 </ClInclude>
42+ <ClInclude Include="nicoapitest.h">
43+ <Filter>ヘッダー ファイル</Filter>
44+ </ClInclude>
4245 </ItemGroup>
4346 <ItemGroup>
4447 <ClCompile Include="stdafx.cpp">