difference transmission of source databases done

This commit is contained in:
2021-09-23 12:40:21 -04:00
parent 6fbe700107
commit 6490db43fc
8 changed files with 320 additions and 44 deletions

View File

@@ -121,6 +121,7 @@
#define SOURCE_HPP
#include "luastack.hpp"
#include "streambuffer.hpp"
class SourceDB {
private:
@@ -143,10 +144,17 @@ public:
// Rebuild the lua environment: clear it out, then reinstall all the
// functions that should be there. See above for more information.
// If an error exists in any of the source files, or when loading any
// of the closures, the error is (currently) printed. We'll come up
// with better error handling later.
// of the closures, the error can optionally be printed or ignored.
//
void rebuild();
void rebuild(bool print_errors);
// Difference transmission.
//
// Note: The patch routine applies the differences to the source
// database, and if there are any changes, it does a source rebuild.
//
void diff(const SourceDB &auth, StreamBuffer *sb);
void patch(StreamBuffer *sb);
// run_unittests
//
@@ -154,6 +162,14 @@ public:
// are any errors, exits the program.
//
void run_unittests();
// Get/Set code (for unit testing).
//
// These functions are direct getters/setters for values in the source
// database. They are intended only for unit testing.
//
void set(const std::string &fn, const std::string &code, int sequence);
std::string get(const std::string &fn);
};
// The Lua 'makeclass' operator.