MCPcopy Create free account
hub / github.com/ElementsProject/elements / FlatFilePos

Class FlatFilePos

src/flatfile.h:14–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12#include <serialize.h>
13
14struct FlatFilePos
15{
16 int nFile;
17 unsigned int nPos;
18
19 SERIALIZE_METHODS(FlatFilePos, obj) { READWRITE(VARINT_MODE(obj.nFile, VarIntMode::NONNEGATIVE_SIGNED), VARINT(obj.nPos)); }
20
21 FlatFilePos() : nFile(-1), nPos(0) {}
22
23 FlatFilePos(int nFileIn, unsigned int nPosIn) :
24 nFile(nFileIn),
25 nPos(nPosIn)
26 {}
27
28 friend bool operator==(const FlatFilePos &a, const FlatFilePos &b) {
29 return (a.nFile == b.nFile && a.nPos == b.nPos);
30 }
31
32 friend bool operator!=(const FlatFilePos &a, const FlatFilePos &b) {
33 return !(a == b);
34 }
35
36 void SetNull() { nFile = -1; nPos = 0; }
37 bool IsNull() const { return (nFile == -1); }
38
39 std::string ToString() const;
40};
41
42/**
43 * FlatFileSeq represents a sequence of numbered files storing raw data. This class facilitates

Callers 1

FlushMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected