remove BackspaceDisorder unescaping v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 28 Nov 2020 21:07:13 +0100
branchv_0
changeset 29 f0bf2755249f
parent 28 596a724fbb83
child 30 8c3fe9af6066
remove BackspaceDisorder unescaping
src/INICommand.cpp
src/lib/BackspaceUnescapingProcessor.h
src/lib/uri.h
--- a/src/INICommand.cpp	Sat Nov 28 20:59:29 2020 +0100
+++ b/src/INICommand.cpp	Sat Nov 28 21:07:13 2020 +0100
@@ -175,7 +175,6 @@
 	std::shared_ptr<INIReader> reader(INIReader::create(input));
 	reader->addUnescapingProcessor(std::make_shared<BasicUnescapingProcessor>(), unescaping::Basic, true);
 	reader->addUnescapingProcessor(std::make_shared<JavaPropertiesUnescapingProcessor>(), unescaping::JavaProperties, false);
-	reader->addUnescapingProcessor(std::make_shared<BackspaceUnescapingProcessor>(false), unescaping::BackspaceDisorder, false);
 	reader->addUnescapingProcessor(std::make_shared<BackspaceUnescapingProcessor>(), unescaping::Backspace, true);
 	reader->addDialect(std::make_shared<JavaPropertiesDialect>(), dialect::JavaProperties, false);
 	reader->addHandler(&handler);
--- a/src/lib/BackspaceUnescapingProcessor.h	Sat Nov 28 20:59:29 2020 +0100
+++ b/src/lib/BackspaceUnescapingProcessor.h	Sat Nov 28 21:07:13 2020 +0100
@@ -30,6 +30,14 @@
 
 class BackspaceUnescapingProcessor : public UnescapingProcessor {
 private:
+	/**
+	 * By default it is set to true, thus no unrecognized escape sequences may left after this stage.
+	 * Setting this to false is dangerous and may lead to errors and ambiguous behavior.
+	 * It should be used only as a last resort.
+	 * Because both "\\ \xxx" and "\ \xxx" will be converted to "\ \xxx" and the information will be lost.
+	 * So, it is usually better to keep the "\" escaped as "\\" and process both the escaped backspaces and unrecognized escape sequences later.
+	 */
+
 	const bool lastEscaphingPhase = true;
 public:
 
@@ -51,17 +59,6 @@
 		return result.str();
 	}
 
-	/**
-	 * @param lastEscaphingPhase whether this is final unescaping stage.
-	 * By default it is set to true, thus no unrecognized escape sequences may left after this stage.
-	 * Setting this to false is dangerous and may lead to errors and ambiguous behavior.
-	 * It should be used only as a last resort.
-	 * Because both "\\ \xxx" and "\ \xxx" will be converted to "\ \xxx" and the information will be lost.
-	 * So, it is usually better to keep the "\" escaped as "\\" and process both the escaped backspaces and unrecognized escape sequences later.
-	 */
-	BackspaceUnescapingProcessor(bool lastEscaphingPhase = true) : lastEscaphingPhase(lastEscaphingPhase) {
-	}
-
 };
 
 }
--- a/src/lib/uri.h	Sat Nov 28 20:59:29 2020 +0100
+++ b/src/lib/uri.h	Sat Nov 28 21:07:13 2020 +0100
@@ -37,7 +37,6 @@
 namespace unescaping {
 static const char* Basic = "unescape-basic";
 static const char* JavaProperties = "unescape-java-properties";
-static const char* BackspaceDisorder = "unescape-backspace-disorder"; // TODO: remove BackspaceDisorder
 static const char* Backspace = "unescape-backspace";
 }