亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 新建 文本文檔 (2).txt

?? sqlite 3.0使用方法
?? TXT
字號(hào):
下面是主函數(shù):
// TestBerkeleyDB.cpp : Defines the entry point for the console application.

#include "stdafx.h"
#include "TestBerkeleyDB.h"
#include "db_cxx.h"
#include "icqtypes.h"
#include "icqdb.h"
#include "Person.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// The one and only application object

CWinApp theApp;

//using namespace std;

bool delPeople(char *fileName, string index)
{
 Db db(NULL, 0); // Instantiate the Db object
 u_int32_t oFlags = DB_CREATE; // Open flags;
 try {
 // Open the database
 db.open(NULL, // Transaction pointer
   fileName, // Database file name
   NULL, // Optional logical database name
   DB_BTREE, // Database access method
   oFlags, // Open flags
   0); // File mode (using defaults)
   // DbException is not subclassed from std::exception, so
   // need to catch both of these.
  } catch(DbException &e) {
  // Error handling code goes here
  } catch(std::exception &e) {
  // Error handling code goes here
  }
 Dbc *cursorp;
 try {
  // Database open omitted
  // Get the cursor
  db.cursor(NULL, &cursorp, 0);
  // Set up our DBTs
  Dbt data;
  Dbt key;
  key.set_data((void*)index.c_str());
  key.set_size(index.length()+1);
  
  // Iterate over the database, deleting each record in turn.
  int ret;
  while ((ret = cursorp->get(&key, &data,
   DB_SET)) == 0) {
   cursorp->del(0);
  }
 } catch(DbException &e) {
  db.err(e.get_errno(), "Error!");
 } catch(std::exception &e) {
  db.errx("Error! %s", e.what());
 }
  // Cursors must be closed
 if (cursorp != NULL)
   cursorp->close();
 db.close(0);
 return true;
}

bool delPeople(char *fileName, uint32 index)
{
 Db db(NULL, 0); // Instantiate the Db object
 u_int32_t oFlags = DB_CREATE; // Open flags;
 try {
  // Open the database
  db.open(NULL, // Transaction pointer
   fileName, // Database file name
   NULL, // Optional logical database name
   DB_BTREE, // Database access method
   oFlags, // Open flags
   0); // File mode (using defaults)
  // DbException is not subclassed from std::exception, so
  // need to catch both of these.
 } catch(DbException &e) {
  // Error handling code goes here
 } catch(std::exception &e) {
  // Error handling code goes here
 }
 Dbc *cursorp;
 try {
  // Database open omitted
  // Get the cursor
  db.cursor(NULL, &cursorp, 0);
  // Set up our DBTs
  Dbt data;
  Dbt key;
  key.set_data(&index);
  key.set_size(sizeof(index));
  
  // Iterate over the database, deleting each record in turn.
  int ret;
  while ((ret = cursorp->get(&key, &data,
   DB_SET)) == 0) {
   cursorp->del(0);
  }
 } catch(DbException &e) {
  db.err(e.get_errno(), "Error!");
 } catch(std::exception &e) {
  db.errx("Error! %s", e.what());
 }
 // Cursors must be closed
 if (cursorp != NULL)
  cursorp->close();
 db.close(0);
 return true;
}

bool loadPeople(char *fileName, uint32 index, DBSerialize &obj)
{
 Db db(NULL, 0); // Instantiate the Db object
 u_int32_t oFlags = DB_CREATE; // Open flags;
 try {
 // Open the database
 db.open(NULL, // Transaction pointer
    fileName, // Database file name
    NULL, // Optional logical database name
    DB_BTREE, // Database access method
    oFlags, // Open flags
    0); // File mode (using defaults)
    // DbException is not subclassed from std::exception, so
    // need to catch both of these.
    } catch(DbException &e) {
    // Error handling code goes here
    } catch(std::exception &e) {
    // Error handling code goes here
    }

 Dbt key, data;
 key.set_data(&index);
 key.set_size(sizeof(index));

 if (db.get(NULL, &key, &data, 0) != 0) {
  db.close(0);
  return false;
 }

 DBInStream in(data.get_data(), data.get_size());
 obj.load(in);

 db.close(0);
 return true;
}

bool loadPeople(char *fileName, string index, DBSerialize &obj)
{
 Db db(NULL, 0); // Instantiate the Db object
 u_int32_t oFlags = DB_CREATE; // Open flags;
 try {
 // Open the database
 db.open(NULL, // Transaction pointer
    fileName, // Database file name
    NULL, // Optional logical database name
    DB_BTREE, // Database access method
    oFlags, // Open flags
    0); // File mode (using defaults)
    // DbException is not subclassed from std::exception, so
    // need to catch both of these.
    } catch(DbException &e) {
    // Error handling code goes here
    } catch(std::exception &e) {
    // Error handling code goes here
    }

 Dbt key, data;
 key.set_data((void*)index.c_str());
 key.set_size(index.length()+1);

 if (db.get(NULL, &key, &data, 0) != 0) {
  db.close(0);
  return false;
 }

 DBInStream in(data.get_data(), data.get_size());
 obj.load(in);

 db.close(0);
 return true;
}

bool savePeople(char *fileName, uint32 index, DBSerialize &obj)
{
 Db db(NULL, 0); // Instantiate the Db object
 u_int32_t oFlags = DB_CREATE; // Open flags;
 try {
 // Open the database
 db.open(NULL, // Transaction pointer
    fileName, // Database file name
    NULL, // Optional logical database name
    DB_BTREE, // Database access method
    oFlags, // Open flags
    0); // File mode (using defaults)
    // DbException is not subclassed from std::exception, so
    // need to catch both of these.
    } catch(DbException &e) {
    // Error handling code goes here
    } catch(std::exception &e) {
    // Error handling code goes here
    }
    
 DBOutStream out;
 obj.save(out);

 Dbt key, data;
 key.set_data(&index);
 key.set_size(sizeof(index));
 data.set_data(out.getData());
 data.set_size(out.getSize());
 int ret = db.put(NULL, &key, &data, 0) ;
 db.close(0);
 return (ret == 0);
}

bool savePeople(char *fileName, string index, DBSerialize &obj)
{
 Db db(NULL, 0); // Instantiate the Db object
 u_int32_t oFlags = DB_CREATE; // Open flags;
 try {
 // Open the database
 db.open(NULL, // Transaction pointer
    fileName, // Database file name
    NULL, // Optional logical database name
    DB_BTREE, // Database access method
    oFlags, // Open flags
    0); // File mode (using defaults)
    // DbException is not subclassed from std::exception, so
    // need to catch both of these.
    } catch(DbException &e) {
    // Error handling code goes here
    } catch(std::exception &e) {
    // Error handling code goes here
    }   
 DBOutStream out;
 obj.save(out);

 Dbt key, data;
 key.set_data((void*)index.c_str());
 key.set_size(index.length()+1);
 data.set_data(out.getData());
 data.set_size(out.getSize());
 int ret = db.put(NULL, &key, &data, 0);
 db.close(0);
 return (ret == 0);
}

bool printAllPeople(char *fileName)
{
 Db db(NULL, 0); // Instantiate the Db object
 u_int32_t oFlags = DB_CREATE; // Open flags;
 try {
  // Open the database
  db.open(NULL, // Transaction pointer
   fileName, // Database file name
   NULL, // Optional logical database name
   DB_BTREE, // Database access method
   oFlags, // Open flags
   0); // File mode (using defaults)
  // DbException is not subclassed from std::exception, so
  // need to catch both of these.
 } catch(DbException &e) {
  // Error handling code goes here
 } catch(std::exception &e) {
  // Error handling code goes here
 }
 Dbc *cursorp;
 try {
  // Database open omitted
  // Get the cursor
  db.cursor(NULL, &cursorp, 0);
  // Set up our DBTs
  Dbt data;
  Dbt key;
  // Iterate over the database, deleting each record in turn.
  int ret;
  while ((ret = cursorp->get(&key, &data,
   DB_NEXT)) == 0) {
   //cursorp->del(0);
   CPerson p;
   DBInStream in(data.get_data(), data.get_size());
   p.load(in);
   printf("%s\n",p.Describe);

  }
 } catch(DbException &e) {
  db.err(e.get_errno(), "Error!");
 } catch(std::exception &e) {
  db.errx("Error! %s", e.what());
 }
 // Cursors must be closed
 if (cursorp != NULL)
  cursorp->close();
 db.close(0);
 return true;
}

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
 int nRetCode = 0;

 // initialize MFC and print and error on failure
 if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
 {
  // TODO: change error code to suit your needs
  cerr << _T("Fatal Error: MFC initialization failed") << endl;
  nRetCode = 1;
 }
 else
 {
  string index1 = "Liang Zhijian";
  string index2 = "Zou Dan";
  CPerson p1;
  p1.age = 0;
  p1.Name = "Liang Zhijian";
  p1.Describe = "student1";

  savePeople("mydb.db",index1,p1);

  CPerson p2;
  p2.age = 1;
  p2.Name = "Zou Dan";
  p2.Describe = "student2"; 
  savePeople("mydb.db",index2,p2);

  CPerson p3;
  loadPeople("mydb.db","Liang Zhijian",p3);
  printf("%s\n",p3.Describe);
  
  printAllPeople("mydb.db");
  delPeople("mydb.db","Liang Zhijian");
  printAllPeople("mydb.db");
 }
 
 return nRetCode;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
94色蜜桃网一区二区三区| 粉嫩一区二区三区在线看| 成人午夜电影久久影院| 日韩一级黄色片| 麻豆91免费观看| 亚洲图片欧美色图| 欧美一级精品在线| 国产成人精品午夜视频免费| 国产成人精品免费视频网站| 精品制服美女丁香| 成人va在线观看| 午夜日韩在线观看| 久久亚洲精精品中文字幕早川悠里| 国产精品白丝jk黑袜喷水| av电影在线观看一区| 日韩精品一级中文字幕精品视频免费观看| 视频一区欧美精品| 成人性生交大片| 欧美xxxx老人做受| 在线精品视频免费观看| 国产毛片精品国产一区二区三区| 亚洲精品videosex极品| www国产成人免费观看视频 深夜成人网| 中文字幕不卡一区| 欧美va亚洲va在线观看蝴蝶网| 国产精品国产三级国产三级人妇| 91丝袜美腿高跟国产极品老师 | 欧美日韩高清不卡| 亚洲六月丁香色婷婷综合久久| 日韩欧美一级在线播放| 91精品国产福利在线观看| 亚洲视频在线观看三级| 久久蜜臀精品av| 国产欧美一区二区精品忘忧草 | 99精品国产99久久久久久白柏| 日本美女一区二区三区视频| 亚洲一区二区三区视频在线播放 | 久久久精品黄色| 国产日韩欧美一区二区三区综合| 欧美日韩你懂得| 欧美日韩一区二区在线观看| 欧美日韩精品综合在线| 一本到一区二区三区| 欧美欧美午夜aⅴ在线观看| 天天综合网天天综合色| 免费观看日韩电影| 国产综合久久久久久鬼色| 久久久久久久性| av激情综合网| 制服丝袜亚洲精品中文字幕| 久久免费视频色| 在线观看视频91| 久久综合中文字幕| 蜜桃av噜噜一区| 青青草伊人久久| 成人一区二区三区视频在线观看| 91免费视频网址| 国产精品99久久久久久久女警| 高清不卡一二三区| 首页欧美精品中文字幕| 国产 欧美在线| 欧美一区二区三区电影| 欧美日韩一区二区电影| 日韩欧美成人午夜| 亚洲一区二区三区中文字幕在线| 国产精品香蕉一区二区三区| 日本欧美大码aⅴ在线播放| 成人午夜视频福利| 国产激情偷乱视频一区二区三区| 夜夜爽夜夜爽精品视频| 成人av网址在线观看| 亚洲精品一区二区三区在线观看| 一区二区三区四区蜜桃| 99久久综合99久久综合网站| 久久综合成人精品亚洲另类欧美| 日韩欧美国产综合| 成人黄色网址在线观看| 粉嫩av亚洲一区二区图片| 久久精品一区蜜桃臀影院| 精品国产一区二区三区久久久蜜月| 亚洲精品高清在线观看| 91国偷自产一区二区开放时间 | 国产精品成人一区二区艾草| 国产麻豆一精品一av一免费 | 精品少妇一区二区三区免费观看| 91精品久久久久久久99蜜桃 | 欧美大片一区二区三区| 欧美精品一区二区三区高清aⅴ| 亚洲精品一区二区三区福利| 久久久三级国产网站| 福利电影一区二区三区| 成人一区在线观看| 亚洲成人动漫精品| 91免费视频大全| 日韩国产欧美一区二区三区| 久久久久九九视频| 精品视频在线视频| 亚洲综合丝袜美腿| 精品99久久久久久| 欧美久久久一区| 中文字幕一区二区5566日韩| 色综合久久综合网欧美综合网| 91成人在线免费观看| 国产欧美一区二区三区沐欲| 91黄色免费看| 波多野结衣欧美| 亚洲制服欧美中文字幕中文字幕| 欧美一区二区三区影视| 亚洲一区二区三区中文字幕 | 一区二区三区中文字幕精品精品| 91麻豆精品国产91久久久资源速度| 国产精品99精品久久免费| 首页综合国产亚洲丝袜| 色哟哟亚洲精品| 一区av在线播放| 欧美日韩精品一区二区三区四区| 成人免费观看男女羞羞视频| 精品区一区二区| 毛片av中文字幕一区二区| 亚洲成人一区在线| 三级一区在线视频先锋| 亚洲国产一区视频| 欧美美女直播网站| 日韩影院精彩在线| 精品久久久影院| 成人高清视频免费观看| 成人午夜av在线| 亚洲夂夂婷婷色拍ww47| 亚洲一级二级三级在线免费观看| 欧美三级电影一区| 欧美大肚乱孕交hd孕妇| 欧美大胆人体bbbb| 成人黄动漫网站免费app| 不卡一卡二卡三乱码免费网站| 一本色道久久综合亚洲精品按摩 | 成人开心网精品视频| 欧美色综合网站| 日韩欧美高清一区| 中文字幕欧美一| 视频一区二区三区入口| 北岛玲一区二区三区四区| 在线观看91视频| 久久久www成人免费毛片麻豆 | 欧美乱熟臀69xxxxxx| 久久久777精品电影网影网| 亚洲女性喷水在线观看一区| 国产欧美一区二区三区鸳鸯浴| 亚洲视频中文字幕| 极品瑜伽女神91| 一区二区三区不卡在线观看| 久久er99精品| 91精品国产品国语在线不卡| 中文字幕在线一区免费| 国产一区二区在线免费观看| 91精选在线观看| 一区二区成人在线| 在线观看国产91| 99国产精品国产精品毛片| 国产成人小视频| 国产.欧美.日韩| 国产精品女上位| 亚洲免费在线视频| 亚洲免费在线观看| 在线一区二区三区四区五区| 99re这里只有精品视频首页| 色婷婷国产精品综合在线观看| 中文久久乱码一区二区| 成年人网站91| 91极品美女在线| 日韩免费电影网站| 欧美大度的电影原声| 中文字幕国产精品一区二区| 亚洲一区免费在线观看| 欧美色精品在线视频| 欧美一级日韩免费不卡| 久久香蕉国产线看观看99| 亚洲人成精品久久久久久| 日韩一区精品视频| 国产精品亚洲视频| 91麻豆精品国产自产在线观看一区| 欧美精品一区二区三| 日本高清不卡aⅴ免费网站| 亚洲影视在线播放| 91麻豆精品一区二区三区| 午夜不卡av免费| 日韩美女久久久| 精品欧美久久久| 免费一级片91| 九色综合狠狠综合久久| 欧美综合色免费| 久久精品视频一区| 亚洲福利电影网| 色老综合老女人久久久| 国产成人免费9x9x人网站视频| 91精品国产福利在线观看| 一区二区三区中文在线| 97超碰欧美中文字幕| 亚洲欧洲av在线| 成人av网址在线观看| 中文字幕在线一区二区三区|