Skip to content

Commit

Permalink
Simple start of ExportTo()
Browse files Browse the repository at this point in the history
  • Loading branch information
ffes committed May 15, 2015
1 parent 77778b1 commit 524cdba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,20 @@ bool Library::DeleteLanguageFromDB(int lang)
/////////////////////////////////////////////////////////////////////////////
//

void Library::ExportTo(LPCWCH filename)
{
// Open the db and create/attach the new db
g_db->Open();
g_db->Attach(filename, L"export");

// Detach exported db and close the current db
g_db->Detach(L"export");
g_db->Close();
}

/////////////////////////////////////////////////////////////////////////////
//

bool Library::LanguageDBHelper(LPCSTR sql, int lang)
{
g_db->Open();
Expand Down
1 change: 1 addition & 0 deletions Library.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Library : public SnippetBase
virtual bool DeleteFromDB();
bool AddLanguageToDB(int lang);
bool DeleteLanguageFromDB(int lang);
void ExportTo(LPCWCH filename);

private:
WCHAR* _CreatedBy;
Expand Down

0 comments on commit 524cdba

Please sign in to comment.