src/lib/INIReader.h
branchv_0
changeset 28 0e7c57d48d1e
parent 26 80e129ec3408
child 29 06aaad12c207
equal deleted inserted replaced
27:fd669e73d39a 28:0e7c57d48d1e
    18 
    18 
    19 #include <string>
    19 #include <string>
    20 #include <istream>
    20 #include <istream>
    21 
    21 
    22 #include "INIContentHandler.h"
    22 #include "INIContentHandler.h"
       
    23 #include "UnescapingProcessor.h"
    23 
    24 
    24 namespace relpipe {
    25 namespace relpipe {
    25 namespace in {
    26 namespace in {
    26 namespace ini {
    27 namespace ini {
    27 namespace lib {
    28 namespace lib {
    30  * TODO: Files in the src/lib directory will be moved to alt2xml and used as a shared library.
    31  * TODO: Files in the src/lib directory will be moved to alt2xml and used as a shared library.
    31  */
    32  */
    32 class INIReader {
    33 class INIReader {
    33 public:
    34 public:
    34 	virtual ~INIReader() = default;
    35 	virtual ~INIReader() = default;
       
    36 	/**
       
    37 	 * TODO: after moving to alt2xml:
       
    38 	 *        - option will be identified by globally unique URI/IRI
       
    39 	 *        - parsers will provide catalog of supported options (names, enum values, documentation)
       
    40 	 *        - options serves as both XML parser features and properties and are mapped to them
       
    41 	 */
       
    42 	virtual void setOption(const std::string& uri, const std::string& value) = 0;
       
    43 	/**
       
    44 	 * TODO: after moving to alt2xml:
       
    45 	 *        - this will be generic handler for SAX event
       
    46 	 *        - but both sides will know the schema (allowed elements and attributes for INI events)
       
    47 	 */
    35 	virtual void addHandler(INIContentHandler* handler) = 0;
    48 	virtual void addHandler(INIContentHandler* handler) = 0;
       
    49 	virtual void addUnescapingProcessor(std::shared_ptr<UnescapingProcessor> processor, const std::string uri, bool enabledByDefault) = 0;
    36 	virtual void process() = 0;
    50 	virtual void process() = 0;
    37 	static INIReader* create(std::istream& input);
    51 	static INIReader* create(std::istream& input);
    38 };
    52 };
    39 
    53 
    40 }
    54 }