Formatter.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * Formatter.h
8  *
9  * @author mikee47 <mike@sillyhouse.net> Nov 2020
10  *
11  ****/
12 
13 #pragma once
14 
15 #include <WString.h>
16 #include <Data/WebConstants.h>
17 
18 namespace Format
19 {
23 class Formatter
24 {
25 public:
29  virtual void escape(String& value) const = 0;
30 
34  virtual void quote(String& value) const = 0;
35 
39  virtual void unQuote(String& value) const = 0;
40 
45  virtual MimeType mimeType() const = 0;
46 };
47 
48 } // namespace Format
MimeType
Definition: WebConstants.h:53
The String class.
Definition: WString.h:136
virtual void escape(String &value) const =0
Perform any necessary text escaping so output is valid.
virtual void unQuote(String &value) const =0
Remove any quotes from a value.
virtual void quote(String &value) const =0
Convert a value into quoted string.
Definition: Formatter.h:18
virtual MimeType mimeType() const =0
Corresponding MIME type for this format.
Virtual class to perform format-specific String adjustments.
Definition: Formatter.h:33