summaryrefslogtreecommitdiffstats
path: root/botan/wrappers/swig/filter.cpp
blob: 53ff0e6a3a25ce8e889146b5dad913b378f51327 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*************************************************
* SWIG Interface for Filter Retrieval            *
* (C) 1999-2003 Jack Lloyd                       *
*************************************************/

#include "base.h"
#include <botan/lookup.h>
#include <botan/filters.h>

/*************************************************
* Filter Creation                                *
*************************************************/
Filter::Filter(const char* filt_string)
   {
   filter = 0;
   pipe_owns = false;

   /*
     Fixme: This is all so totally wrong. It needs to have full argument
     processing for everything, all that kind of crap.
   */
   const std::string filt_name = filt_string;

   if(Botan::have_hash(filt_name))
      filter = new Botan::Hash_Filter(filt_name);
   else if(filt_name == "Hex_Encoder")
      filter = new Botan::Hex_Encoder;
   }

/*************************************************
* Filter Destruction                             *
*************************************************/
Filter::~Filter()
   {
   /*
   if(!pipe_owns)
      delete filter;
   */
   }