diff options
author | mistachkin <mistachkin@noemail.net> | 2016-02-25 02:49:58 +0000 |
---|---|---|
committer | mistachkin <mistachkin@noemail.net> | 2016-02-25 02:49:58 +0000 |
commit | c32db469f4fc67e2decbc200af3598093093c9ec (patch) | |
tree | d9e9a2ac49b20fb09959e9f3ef71bbf3b0f8ff51 /vsixtest/MainPage.xaml.cpp | |
parent | 5dad68d3c75014a1a9e9a38c1480f5f96524688e (diff) | |
download | sqlite-c32db469f4fc67e2decbc200af3598093093c9ec.tar.gz sqlite-c32db469f4fc67e2decbc200af3598093093c9ec.zip |
More work. Install and build steps are now tested.
FossilOrigin-Name: 0ab74373bd37d48d6afa7aecb67885afcd3a85b1
Diffstat (limited to 'vsixtest/MainPage.xaml.cpp')
-rw-r--r-- | vsixtest/MainPage.xaml.cpp | 80 |
1 files changed, 53 insertions, 27 deletions
diff --git a/vsixtest/MainPage.xaml.cpp b/vsixtest/MainPage.xaml.cpp index f615f4d89..e67dcb83b 100644 --- a/vsixtest/MainPage.xaml.cpp +++ b/vsixtest/MainPage.xaml.cpp @@ -1,27 +1,53 @@ -//
-// MainPage.xaml.cpp
-// Implementation of the MainPage class.
-//
-
-#include "pch.h"
-#include "MainPage.xaml.h"
-
-using namespace vsixtest;
-
-using namespace Platform;
-using namespace Windows::Foundation;
-using namespace Windows::Foundation::Collections;
-using namespace Windows::UI::Xaml;
-using namespace Windows::UI::Xaml::Controls;
-using namespace Windows::UI::Xaml::Controls::Primitives;
-using namespace Windows::UI::Xaml::Data;
-using namespace Windows::UI::Xaml::Input;
-using namespace Windows::UI::Xaml::Media;
-using namespace Windows::UI::Xaml::Navigation;
-
-// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
-
-MainPage::MainPage()
-{
- InitializeComponent();
-}
+// +// MainPage.xaml.cpp +// Implementation of the MainPage class. +// + +#include "pch.h" +#include "MainPage.xaml.h" +#include "sqlite3.h" + +using namespace vsixtest; + +using namespace Platform; +using namespace Windows::Foundation; +using namespace Windows::Foundation::Collections; +using namespace Windows::UI::Xaml; +using namespace Windows::UI::Xaml::Controls; +using namespace Windows::UI::Xaml::Controls::Primitives; +using namespace Windows::UI::Xaml::Data; +using namespace Windows::UI::Xaml::Input; +using namespace Windows::UI::Xaml::Media; +using namespace Windows::UI::Xaml::Navigation; + +// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 + +MainPage::MainPage() +{ + InitializeComponent(); + UseSQLite(); +} + +void MainPage::UseSQLite(void) +{ + int rc = SQLITE_OK; + sqlite3 *pDb = nullptr; + + rc = sqlite3_open_v2("test.db", &pDb, + SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, nullptr); + + if (rc != SQLITE_OK) + throw ref new FailureException("Failed to open database."); + + rc = sqlite3_exec(pDb, "VACUUM;", nullptr, nullptr, nullptr); + + if (rc != SQLITE_OK) + throw ref new FailureException("Failed to vacuum database."); + + rc = sqlite3_close(pDb); + + if (rc != SQLITE_OK) + throw ref new FailureException("Failed to close database."); + + pDb = nullptr; +} |