需要一些帮助,以解决错误,文件系统项目达到顶峰 [英] Need some help with errors, culmination of a File System Project

查看:100
本文介绍了需要一些帮助,以解决错误,文件系统项目达到顶峰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

类BufferFile {

public:

BufferFile(IOBuffer&);

int Open(char *);

int Create(char *);

int Close();

int Rewind();

int Read(int recaddr = -1);

int Write(int recaddr = -1);

int Append();

IOBuffer& GetBuffer();

受保护:

IOBuffer&缓冲区;

std :: fstream文件;

int HeaderSize;

int ReadHeader();

int WriteHeader(); < br>
};

class BufferFile{
public:
BufferFile(IOBuffer &);
int Open(char *);
int Create(char *);
int Close();
int Rewind();
int Read(int recaddr = -1);
int Write(int recaddr = -1);
int Append();
IOBuffer & GetBuffer();
protected:
IOBuffer & Buffer;
std::fstream File;
int HeaderSize;
int ReadHeader();
int WriteHeader();
};

BufferFile::BufferFile(IOBuffer & from):Buffer(from){}    

int BufferFile::Read(int recaddr){  
    if(recaddr==1) return Buffer.Write(File);  
    else return Buffer.DWrite(File, recaddr);  
}  

int BufferFile::Append(){  
    File.seekp(0,std::ios::end);  
    return Buffer.Write(File);  
}  

IOBuffer & BufferFile::GetBuffer(){  
    return Buffer;  
}  

int BufferFile::ReadHeader(){  
    return Buffer.ReadHeader(File);  
}  

int BufferFile::WriteHeader(){  
    return Buffer.WriteHeader(File);  
}  

我从IOBuffer字段中遇到了几个错误,说未声明

I am getting several errors form the IOBuffer field, saying that it was not declared in the function scopes or "expected `)' before ‘&’ token" on the constructor.

感谢任何帮助

推荐答案

几个错误提到 IOBuffer类没有名为 pack的成员。该消息是绝对正确的,但不正确;如果您查看标题,它有一个名为 Pack 的方法,其首字母为 P 。 C ++区分大小写!

Several of the errors mention that class IOBuffer has no member named "pack". The message is absolutely correct, it doesn't; if you look at the header, it has a method named Pack, with a capital P. C++ is case-sensitive!

由于您的包含文件没有包含卫兵,以防止其被多次包含-您需要解决该问题。

The errors about "redefinition" are happening because your include files don't have include guards to prevent them from being included multiple times -- you need to fix that.

只剩下一些错误;当您掌握了最后所有内容后,请再次与我们联系。这次没有图像!没有链接!只需粘贴错误消息的实际文本以及发生错误的几行代码,就会有人可以为您提供帮助。

That leaves only a few errors remaining; when you've got everything down to those last few, come back and talk to us again. This time, no images! No links! Just paste the actual text of the error message, and the few lines of code where the errors occur, and somebody will be able to help you.

这篇关于需要一些帮助,以解决错误,文件系统项目达到顶峰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆