mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 13:37:00 -04:00
Clean up pointer use:
* Use unique_ptr for Actions instead of manual memory management * Use unique_ptr in KeywordDatabase * Use unique_ptr instead of shared_ptr for file formats * Don't pass shared_ptr to Reader/Writer, use references instead Also * Switch to C++17 so we can use map::try_emplace
This commit is contained in:
@@ -19,14 +19,11 @@ DECLARE_POINTER_TYPE(StyleSheet);
|
||||
|
||||
// ----------------------------------------------------------------------------- : Writer
|
||||
|
||||
typedef wxOutputStream OutputStream;
|
||||
typedef shared_ptr<wxOutputStream> OutputStreamP;
|
||||
|
||||
/// The Writer can be used for writing (serializing) objects
|
||||
class Writer {
|
||||
public:
|
||||
/// Construct a writer that writes to the given output stream
|
||||
Writer(const OutputStreamP& output, Version file_app_version);
|
||||
Writer(OutputStream& output, Version file_app_version);
|
||||
|
||||
/// Tell the reflection code we are not reading
|
||||
inline bool reading() const { return false; }
|
||||
@@ -81,7 +78,7 @@ class Writer {
|
||||
vector<const Char*> pending_opened;
|
||||
|
||||
/// Output stream we are writing to
|
||||
OutputStreamP output;
|
||||
OutputStream& output;
|
||||
/// Text stream wrapping the output stream
|
||||
wxTextOutputStream stream;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user