Mercurial > mercurial > hgweb_searcher03.cgi
diff src/db.cpp @ 11:dfcf8c973219
Implement Cache maker.
author | pyon@macmini |
---|---|
date | Wed, 07 May 2014 20:38:57 +0900 |
parents | b455f2d8aac9 |
children | bbd65edf71d4 |
line wrap: on
line diff
--- a/src/db.cpp Mon Apr 28 18:14:04 2014 +0900 +++ b/src/db.cpp Wed May 07 20:38:57 2014 +0900 @@ -1,5 +1,5 @@ // Filename : db.cpp -// Last Change: 16-Apr-2014. +// Last Change: 02-May-2014. // #include "db.h" @@ -229,6 +229,31 @@ return data; } +/* 範囲日時のパスを取得 */ +wxArrayString GetPathes( wxString from, wxString to ) +{ + wxArrayString path; + + wxString gszFile = wxGetCwd() + wxFILE_SEP_PATH + wxT("db") + wxFILE_SEP_PATH + wxT("ccn.db"); + wxSQLite3Database ccndb; + ccndb.Open( gszFile ); + + wxSQLite3Statement stmt = ccndb.PrepareStatement( "SELECT path FROM path WHERE date >= ? AND date <= ?" ); + stmt.Bind( 1, from ); + stmt.Bind( 2, to ); + wxSQLite3ResultSet q = stmt.ExecuteQuery(); + + if ( !q.IsNull(0) ) { + while ( q.NextRow() ) { + path.Add( q.GetString(0) ); + } + } + stmt.Finalize(); + ccndb.Close(); + + return path; +} + /* 合議体から被保険者番号を取得 */ wxArrayString GetHhsNoByCcn( wxString ccn, wxString date ) {