• 大小: 10.61MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-23
  • 语言: 其他
  • 标签: C++  library  

资源简介

图书馆管理系统程序+全套开发文档(系统计划书,系统使用说明,测试报告,UML分析与设计,工作记录)

资源截图

代码片段和文件信息

#include
#include “BookClass.h“

using namespace std;

///构造函数

LBook::LBook(book Book)
{
    this->Book.bookId = Book.bookId;
    this->Book.peopleId = Book.peopleId;
    this->Book.bookClass = Book.bookClass;
    this->Book.price = Book.price;
    memcpy(this->Book.bookNameBook.bookNamebookNameLength);
    memcpy(this->Book.publisherBook.publisherpublisherLength);
    memcpy(this->Book.authorBook.authorauthorLength);
    memcpy(this->Book.publishDateBook.publishDatepublishDateLength);
    memcpy(this->Book.borrowTimeBook.borrowTimeborrowTimeLength);
    this->Book.borrowFlag = Book.borrowFlag;
    this->Book.isReservedFlag = Book.isReservedFlag;
    this->Book.isPreservedFlag = Book.isPreservedFlag;
    this->Book.isLated = Book.isLated;
    this->Book.isDeleted = Book.isDeleted;
    this->Book.isRealDeleted = Book.isRealDeleted;

}
/*
///构造函数(仅有ID版)

LBook::LBook(unsigned int bookIdtstring fname)
{
    if((searchInstanceOfBook(bookIdtfname))< 0)
    {
        Book.bookId = bookIdt;
        BookClassIO bm ;//定义一个书籍管理类的对象bm = bookmanage的意思;
        book ret[10];//ret是return,用于接收返回来的十个book类型的书籍数据
        int distance = 0;//初始化开始查找的位置为0.
        int flag = 0;//标志是否找到
        while(distance < (bm.currentFileSize(fname)-1)) //当数据没找完时bm.currentFileSize(fname)为当前文件里实体个数
        {

            int state = bm.readFile(retfnamedistance2);//int readFile(book returnInfo[10]string fnameint distanceint mode)//读文件
            if(state == 0) //state记录返回的文件打开情况,0为成功打开
            {
                for(int i = 0; i < 10; i++) //十个十个地拿与检测是否匹配
                {
                    if(bookIdt == ret[i].bookId)
                    {
                        Book.bookClass = ret[i].bookClass;
                        Book.price = ret[i].price;
                        memcpy(Book.bookNameret[i].bookNamebookNameLength);
                        memcpy(Book.publisherret[i].publisherpublisherLength);
                        memcpy(Book.authorret[i].authorauthorLength);
                        memcpy(Book.publishDateret[i].publishDatepublishDateLength);
                        memcpy(Book.borrowTimeret[i].borrowTimeborrowTimeLength);
                        Book.borrowFlag = ret[i].borrowFlag;
                        Book.isReservedFlag = ret[i].isReservedFlag;
                        Book.isPreservedFlag = ret[i].isPreservedFlag;
                        Book.isLated = ret[i].isLated;
                        Book.isDeleted = ret[i].isDeleted;
                        Book.isRealDeleted = ret[i].isRealDeleted;
                        cout << “This is a constructor(bookId) !“ << endl;
                        flag = 1;
                        break;
                    }
                    distance++;//找不到则找下一个
                }
                //前面十个找不到的话,再重新循环读十个

            }
            else  //如果没成功打开文件
            {
                cout << “Read file error!QAQ!“

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-07-23 21:31  LibraryManagement\
     文件        8317  2017-12-21 23:56  LibraryManagement\AddOption.h
     目录           0  2017-12-09 16:54  LibraryManagement\bin\
     目录           0  2017-12-22 00:00  LibraryManagement\bin\Debug\
     文件     3487188  2017-12-22 00:01  LibraryManagement\bin\Debug\LibraryManagement.exe
     文件       11471  2018-03-02 10:50  LibraryManagement\BookClass.cpp
     文件        3314  2017-12-10 12:09  LibraryManagement\BookClass.h
     文件       19021  2017-12-10 12:09  LibraryManagement\BookManagementIO.h
     文件        7746  2017-12-10 14:14  LibraryManagement\BookManagementIOHeader.h
     文件       52744  2017-12-03 14:22  LibraryManagement\BookTestDataV1.dat
     文件         797  2017-12-21 21:12  LibraryManagement\CreateTestFile.cpp
     文件     1115978  2017-12-21 21:13  LibraryManagement\CreateTestFile.exe
     文件       15734  2017-12-21 21:13  LibraryManagement\CreateTestFile.o
     文件       14255  2017-12-21 22:18  LibraryManagement\DeleteOption.h
     文件         517  2017-12-19 09:16  LibraryManagement\Display.h
     文件     2323696  2017-12-21 23:47  LibraryManagement\fileBookInfo.dat
     文件         676  2017-12-21 22:36  LibraryManagement\filePeopleInfo.dat
     文件        4338  2017-12-10 12:09  LibraryManagement\FuzzyQuery.h
     文件        6499  2017-12-10 14:16  LibraryManagement\IdGenerator.h
     文件        8113  2017-12-05 21:19  LibraryManagement\IndexBuilder.h
     文件       13216  2017-12-03 14:22  LibraryManagement\InterfaceMain.cpp
     文件        1995  2017-12-21 21:04  LibraryManagement\LibraryManagement.cbp
     文件       26884  2017-12-21 22:35  LibraryManagement\LibraryManagement.depend
     文件        4676  2017-12-22 00:07  LibraryManagement\LibraryManagement.layout
     文件          13  2017-11-12 20:17  LibraryManagement\log.txt
     文件         388  2017-12-10 14:25  LibraryManagement\LogUtil.h
     文件        3013  2017-12-09 18:42  LibraryManagement\Ltime.cpp
     文件         613  2017-12-10 12:10  LibraryManagement\Ltime.h
     文件         729  2017-12-10 14:00  LibraryManagement\Manager.h
     目录           0  2017-12-09 16:54  LibraryManagement\obj\
     目录           0  2017-12-22 00:00  LibraryManagement\obj\Debug\
............此处省略139个文件信息

评论

共有 条评论