mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Trivial: Doxygenize existing CBufferedFile and VectorReader comments
This commit is contained in:
parent
9431e1b915
commit
70e7cee960
1 changed files with 16 additions and 16 deletions
|
@ -139,7 +139,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* @param[in] type Serialization Type
|
* @param[in] type Serialization Type
|
||||||
* @param[in] version Serialization Version (including any flags)
|
* @param[in] version Serialization Version (including any flags)
|
||||||
* @param[in] data Referenced byte vector to overwrite/append
|
* @param[in] data Referenced byte vector to overwrite/append
|
||||||
|
@ -153,7 +153,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* (other params same as above)
|
* (other params same as above)
|
||||||
* @param[in] args A list of items to deserialize starting at pos.
|
* @param[in] args A list of items to deserialize starting at pos.
|
||||||
*/
|
*/
|
||||||
|
@ -715,15 +715,15 @@ private:
|
||||||
const int nType;
|
const int nType;
|
||||||
const int nVersion;
|
const int nVersion;
|
||||||
|
|
||||||
FILE *src; // source file
|
FILE *src; //!< source file
|
||||||
uint64_t nSrcPos; // how many bytes have been read from source
|
uint64_t nSrcPos; //!< how many bytes have been read from source
|
||||||
uint64_t nReadPos; // how many bytes have been read from this
|
uint64_t nReadPos; //!< how many bytes have been read from this
|
||||||
uint64_t nReadLimit; // up to which position we're allowed to read
|
uint64_t nReadLimit; //!< up to which position we're allowed to read
|
||||||
uint64_t nRewind; // how many bytes we guarantee to rewind
|
uint64_t nRewind; //!< how many bytes we guarantee to rewind
|
||||||
std::vector<char> vchBuf; // the buffer
|
std::vector<char> vchBuf; //!< the buffer
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// read data from the source to fill the buffer
|
//! read data from the source to fill the buffer
|
||||||
bool Fill() {
|
bool Fill() {
|
||||||
unsigned int pos = nSrcPos % vchBuf.size();
|
unsigned int pos = nSrcPos % vchBuf.size();
|
||||||
unsigned int readNow = vchBuf.size() - pos;
|
unsigned int readNow = vchBuf.size() - pos;
|
||||||
|
@ -768,12 +768,12 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check whether we're at the end of the source file
|
//! check whether we're at the end of the source file
|
||||||
bool eof() const {
|
bool eof() const {
|
||||||
return nReadPos == nSrcPos && feof(src);
|
return nReadPos == nSrcPos && feof(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
// read a number of bytes
|
//! read a number of bytes
|
||||||
void read(char *pch, size_t nSize) {
|
void read(char *pch, size_t nSize) {
|
||||||
if (nSize + nReadPos > nReadLimit)
|
if (nSize + nReadPos > nReadLimit)
|
||||||
throw std::ios_base::failure("Read attempted past buffer limit");
|
throw std::ios_base::failure("Read attempted past buffer limit");
|
||||||
|
@ -795,12 +795,12 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the current reading position
|
//! return the current reading position
|
||||||
uint64_t GetPos() const {
|
uint64_t GetPos() const {
|
||||||
return nReadPos;
|
return nReadPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
// rewind to a given reading position
|
//! rewind to a given reading position
|
||||||
bool SetPos(uint64_t nPos) {
|
bool SetPos(uint64_t nPos) {
|
||||||
nReadPos = nPos;
|
nReadPos = nPos;
|
||||||
if (nReadPos + nRewind < nSrcPos) {
|
if (nReadPos + nRewind < nSrcPos) {
|
||||||
|
@ -826,8 +826,8 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent reading beyond a certain position
|
//! prevent reading beyond a certain position
|
||||||
// no argument removes the limit
|
//! no argument removes the limit
|
||||||
bool SetLimit(uint64_t nPos = std::numeric_limits<uint64_t>::max()) {
|
bool SetLimit(uint64_t nPos = std::numeric_limits<uint64_t>::max()) {
|
||||||
if (nPos < nReadPos)
|
if (nPos < nReadPos)
|
||||||
return false;
|
return false;
|
||||||
|
@ -842,7 +842,7 @@ public:
|
||||||
return (*this);
|
return (*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// search for a given byte in the stream, and remain positioned on it
|
//! search for a given byte in the stream, and remain positioned on it
|
||||||
void FindByte(char ch) {
|
void FindByte(char ch) {
|
||||||
while (true) {
|
while (true) {
|
||||||
if (nReadPos == nSrcPos)
|
if (nReadPos == nSrcPos)
|
||||||
|
|
Loading…
Add table
Reference in a new issue