mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 13:17:00 -04:00
Add to_json and from_json script functions
This commit is contained in:
@@ -118,6 +118,9 @@ public:
|
||||
inline Packaged* getPackage() const { return package; }
|
||||
|
||||
String addLocale(String);
|
||||
|
||||
/// Set the value that will be returned by the next getValue() call (may mess up the state of the reader)
|
||||
inline void setValue(const String& value) { state = UNHANDLED; previous_value = value; };
|
||||
|
||||
private:
|
||||
// --------------------------------------------------- : Data
|
||||
|
||||
@@ -16,6 +16,12 @@
|
||||
using boost::tribool;
|
||||
|
||||
// ----------------------------------------------------------------------------- : Writer
|
||||
|
||||
Writer::Writer(OutputStream& output)
|
||||
: indentation(0)
|
||||
, output(output)
|
||||
, stream(output, wxEOL_UNIX, wxMBConvUTF8())
|
||||
{}
|
||||
|
||||
Writer::Writer(OutputStream& output, Version file_app_version)
|
||||
: indentation(0)
|
||||
|
||||
@@ -25,8 +25,9 @@ DECLARE_POINTER_TYPE(StyleSheet);
|
||||
class Writer {
|
||||
public:
|
||||
/// Construct a writer that writes to the given output stream
|
||||
Writer(OutputStream& output);
|
||||
Writer(OutputStream& output, Version file_app_version);
|
||||
|
||||
|
||||
/// Tell the reflection code we are not reading
|
||||
static constexpr bool isReading = false;
|
||||
static constexpr bool isWriting = true;
|
||||
@@ -72,11 +73,11 @@ public:
|
||||
// special behaviour
|
||||
void handle(const GameP&);
|
||||
void handle(const StyleSheetP&);
|
||||
|
||||
private:
|
||||
// --------------------------------------------------- : Data
|
||||
|
||||
/// Indentation of the current block
|
||||
int indentation;
|
||||
private:
|
||||
// --------------------------------------------------- : Data
|
||||
/// Blocks opened to which nothing has been written
|
||||
vector<const Char*> pending_opened;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user