src/lib/GenericASN1ContentHandler.h
branchv_0
changeset 4 7230e1ea0b07
parent 1 2179f13227f4
child 5 15c3221e66af
equal deleted inserted replaced
3:68026fe3aaf5 4:7230e1ea0b07
    14  * You should have received a copy of the GNU General Public License
    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/>.
    15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
    16  */
    16  */
    17 #pragma once
    17 #pragma once
    18 
    18 
       
    19 #include "ASN1ContentHandler.h"
       
    20 #include "SAXContentHandler.h"
       
    21 
    19 namespace relpipe {
    22 namespace relpipe {
    20 namespace in {
    23 namespace in {
    21 namespace asn1 {
    24 namespace asn1 {
    22 namespace lib {
    25 namespace lib {
    23 
    26 
       
    27 /**
       
    28  * Converts ASN.1 events to XML SAX events.
       
    29  * 
       
    30  * Does not need to know anything about the model/schema – works with generic events (nodes).
       
    31  */
    24 class GenericASN1ContentHandler : public ASN1ContentHandler {
    32 class GenericASN1ContentHandler : public ASN1ContentHandler {
       
    33 private:
       
    34 	SAXContentHandlerProxy handlers;
       
    35 public:
       
    36 
       
    37 	void addHandler(std::shared_ptr<SAXContentHandler> handler) {
       
    38 		handlers.addHandler(handler);
       
    39 	}
       
    40 
       
    41 	virtual ~GenericASN1ContentHandler() {
       
    42 	}
       
    43 
       
    44 	void abc() override {
       
    45 	};
       
    46 
       
    47 	void def(int a) override {
       
    48 	};
       
    49 
       
    50 	void ghi(int a, int b) override {
       
    51 	};
       
    52 
    25 };
    53 };
    26 
    54 
    27 }
    55 }
    28 }
    56 }
    29 }
    57 }