Add AbstractTextDumper to implement stream holding and indendation

This commit is contained in:
Jan
2022-01-15 17:44:56 +01:00
parent c9a0392fc1
commit b48d55671e
8 changed files with 60 additions and 38 deletions

View File

@ -2,8 +2,8 @@
#include <regex>
StringFileDumper::StringFileDumper(Zone* zone, std::ostream& stream)
: m_zone(zone),
m_stream(stream),
: AbstractTextDumper(stream),
m_zone(zone),
m_language_caps("ENGLISH"),
m_wrote_header(false)
{
@ -42,7 +42,7 @@ void StringFileDumper::WriteLocalizeEntry(const std::string& reference, const st
WriteHeader();
m_stream << "\n";
m_stream << "REFERENCE " << reference <<"\n";
m_stream << "REFERENCE " << reference << "\n";
auto escapedValue = std::regex_replace(value, std::regex("\n"), "\\n");
escapedValue = std::regex_replace(escapedValue, std::regex("\r"), "\\r");

View File

@ -1,13 +1,11 @@
#pragma once
#include <ostream>
#include "Dumping/AbstractTextDumper.h"
#include "Zone/Zone.h"
class StringFileDumper
class StringFileDumper : AbstractTextDumper
{
Zone* m_zone;
std::ostream& m_stream;
std::string m_config_file;
std::string m_notes;