mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
updated smartcontracts
- updated smartcontracts - updated fullnode database layout - fixed memory leak in blockchain-explorer - updated tonlib
This commit is contained in:
parent
9c9248a9ae
commit
c860ce3d1e
104 changed files with 7309 additions and 1335 deletions
40
validator/db/package.hpp
Normal file
40
validator/db/package.hpp
Normal file
|
@ -0,0 +1,40 @@
|
|||
#pragma once
|
||||
|
||||
#include "td/actor/actor.h"
|
||||
#include "td/utils/port/FileFd.h"
|
||||
#include "td/utils/buffer.h"
|
||||
|
||||
namespace ton {
|
||||
|
||||
class Package {
|
||||
public:
|
||||
static td::Result<Package> open(std::string path, bool read_only = false, bool create = false);
|
||||
|
||||
Package(td::FileFd fd);
|
||||
|
||||
td::Status truncate(td::uint64 size);
|
||||
|
||||
td::uint64 append(std::string filename, td::Slice data);
|
||||
td::uint64 size() const;
|
||||
td::Result<std::pair<std::string, td::BufferSlice>> read(td::uint64 offset) const;
|
||||
td::Result<td::uint64> advance(td::uint64 offset);
|
||||
|
||||
struct Iterator {
|
||||
td::uint64 offset;
|
||||
Package &package;
|
||||
|
||||
Iterator operator++(int);
|
||||
const Iterator operator++(int) const;
|
||||
td::Result<std::pair<std::string, td::BufferSlice>> read() const;
|
||||
};
|
||||
|
||||
Iterator begin();
|
||||
const Iterator begin() const;
|
||||
Iterator end();
|
||||
const Iterator end() const;
|
||||
|
||||
private:
|
||||
td::FileFd fd_;
|
||||
};
|
||||
|
||||
} // namespace ton
|
Loading…
Add table
Add a link
Reference in a new issue