src/lib/ASN1Reader.h
branchv_0
changeset 1 68a281aefa76
equal deleted inserted replaced
0:28294b895e5e 1:68a281aefa76
       
     1 /**
       
     2  * Relational pipes
       
     3  * Copyright © 2021 František Kučera (Frantovo.cz, GlobalCode.info)
       
     4  *
       
     5  * This program is free software: you can redistribute it and/or modify
       
     6  * it under the terms of the GNU General Public License as published by
       
     7  * the Free Software Foundation, version 3 of the License.
       
     8  *
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
       
    12  * GNU General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU General Public License
       
    15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
       
    16  */
       
    17 #pragma once
       
    18 
       
    19 #include <memory>
       
    20 
       
    21 #include "AbstractParser.h"
       
    22 #include "ASN1ContentHandler.h"
       
    23 
       
    24 namespace relpipe {
       
    25 namespace in {
       
    26 namespace asn1 {
       
    27 namespace lib {
       
    28 
       
    29 class ASN1Reader : public AbstractParser {
       
    30 public:
       
    31 	virtual ~ASN1Reader() = default;
       
    32 
       
    33 	virtual void addHandler(std::shared_ptr<ASN1ContentHandler> handler) {
       
    34 		handlers->addHandler(handler);
       
    35 	};
       
    36 
       
    37 	/**
       
    38 	 * @param uri identifier of the option
       
    39 	 * @param value value of the option
       
    40 	 * @return whether this option is supported and was applied here
       
    41 	 */
       
    42 	virtual bool setOption(const std::string& uri, const std::string& value) {
       
    43 		return false;
       
    44 	}
       
    45 
       
    46 protected:
       
    47 	std::shared_ptr<ASN1ContentHandlerProxy> handlers = std::make_shared<ASN1ContentHandlerProxy>();
       
    48 };
       
    49 
       
    50 }
       
    51 }
       
    52 }
       
    53 }