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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>XML-Security-C: TXFMBase.hpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.2 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">src</a> / <a class="el" href="dir_000004.html">transformers</a></div>
<h1>TXFMBase.hpp</h1><a href="TXFMBase_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/*</span>
00002 <span class="comment"> * Copyright 2002-2005 The Apache Software Foundation.</span>
00003 <span class="comment"> *</span>
00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span>
00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
00006 <span class="comment"> * You may obtain a copy of the License at</span>
00007 <span class="comment"> *</span>
00008 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span>
00009 <span class="comment"> *</span>
00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span>
00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
00014 <span class="comment"> * limitations under the License.</span>
00015 <span class="comment"> */</span>
00016
00017 <span class="comment">/*</span>
00018 <span class="comment"> * XSEC</span>
00019 <span class="comment"> *</span>
00020 <span class="comment"> * TXFMBase := Base (virtual) class that defines a DSIG Transformer</span>
00021 <span class="comment"> *</span>
00022 <span class="comment"> * Author(s): Berin Lautenbach</span>
00023 <span class="comment"> *</span>
00024 <span class="comment"> * $Id: TXFMBase.hpp,v 1.10 2005/02/03 13:50:12 milan Exp $</span>
00025 <span class="comment"> *</span>
00026 <span class="comment"> */</span>
00027
00028 <span class="preprocessor">#ifndef TXFMBASE_INCLUDE</span>
00029 <span class="preprocessor"></span><span class="preprocessor">#define TXFMBASE_INCLUDE</span>
00030 <span class="preprocessor"></span>
00031 <span class="preprocessor">#include <xercesc/dom/DOM.hpp></span>
00032 <span class="preprocessor">#include <xsec/canon/XSECC14n20010315.hpp></span>
00033 <span class="preprocessor">#include <xsec/utils/XSECNameSpaceExpander.hpp></span>
00034 <span class="preprocessor">#include <xsec/utils/XSECXPathNodeList.hpp></span>
00035
00036 <span class="comment">// Xalan</span>
00037
00038 <span class="preprocessor">#include <xercesc/util/BinInputStream.hpp></span>
00039
00040 <span class="preprocessor">#include <stdlib.h></span>
00041
00042 <span class="keyword">class </span><a class="code" href="classTXFMChain.html">TXFMChain</a>;
00043
<a name="l00063"></a><a class="code" href="classTXFMBase.html">00063</a> <span class="keyword">class </span><a class="code" href="XSECDefs_8hpp.html#a9">DSIG_EXPORT</a> <a class="code" href="classTXFMBase.html">TXFMBase</a> {
00064
00065 <span class="keyword">protected</span>:
00066
<a name="l00067"></a><a class="code" href="classTXFMBase.html#p0">00067</a> <a class="code" href="classTXFMBase.html">TXFMBase</a> *input; <span class="comment">// The input source that we read from</span>
<a name="l00068"></a><a class="code" href="classTXFMBase.html#p1">00068</a> <span class="keywordtype">bool</span> keepComments; <span class="comment">// Each transform needs to tell the next whether comments are still in</span>
<a name="l00069"></a><a class="code" href="classTXFMBase.html#p2">00069</a> <a class="code" href="classXSECNameSpaceExpander.html">XSECNameSpaceExpander</a> * mp_nse; <span class="comment">// For expanding document name spaces</span>
00070 <a class="code" href="XSECDefs_8hpp.html#a0">XERCES_CPP_NAMESPACE_QUALIFIER</a> DOMDocument
<a name="l00071"></a><a class="code" href="classTXFMBase.html#p3">00071</a> * mp_expansionDoc; <span class="comment">// For expanding</span>
<a name="l00072"></a><a class="code" href="classTXFMBase.html#p4">00072</a> <a class="code" href="classXSECXPathNodeList.html">XSECXPathNodeList</a> m_XPathMap; <span class="comment">// For node lists if necessary</span>
00073
00074 <span class="keyword">public</span>:
00075
<a name="l00076"></a><a class="code" href="classTXFMBase.html#a0">00076</a> <a class="code" href="classTXFMBase.html">TXFMBase</a>(<a class="code" href="XSECDefs_8hpp.html#a0">XERCES_CPP_NAMESPACE_QUALIFIER</a> DOMDocument *doc)
00077 {input = NULL; keepComments = <span class="keyword">true</span>; mp_nse = NULL; mp_expansionDoc = doc;}
00078 <span class="keyword">virtual</span> ~<a class="code" href="classTXFMBase.html">TXFMBase</a>();
00079
00080 <span class="comment">// For getting/setting input/output type</span>
00081
<a name="l00082"></a><a class="code" href="classTXFMBase.html#w8">00082</a> <span class="keyword">enum</span> ioType {
00083
00084 NONE = 1, <span class="comment">// For when there is no Input</span>
00085 BYTE_STREAM = 2,
00086 DOM_NODES = 3
00087
00088 };
00089
<a name="l00090"></a><a class="code" href="classTXFMBase.html#w9">00090</a> <span class="keyword">enum</span> nodeType {
00091
00092 DOM_NODE_NONE = 1, <span class="comment">// No nodes set</span>
00093 DOM_NODE_DOCUMENT = 2, <span class="comment">// This is a dom document</span>
00094 DOM_NODE_DOCUMENT_FRAGMENT = 3, <span class="comment">// This is a fragment only</span>
00095 DOM_NODE_DOCUMENT_NODE = 4, <span class="comment">// This is a fragment id;d by DOM_Node</span>
00096 DOM_NODE_XPATH_NODESET = 5 <span class="comment">// This is a set of nodes</span>
00097
00098 };
00099
00100
00101 <span class="comment">// Methods to set the inputs</span>
00102 <span class="comment">// NOTE: If this throws an exception, the implementation class</span>
00103 <span class="comment">// MUST have added the newInput to it's chain to ensure that</span>
00104 <span class="comment">// Deletion of the chain will include everything.</span>
00105
00106 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setInput(<a class="code" href="classTXFMBase.html">TXFMBase</a> *newInput) = 0;
00107
00108 <span class="comment">// Methods to get tranform output type and input requirement</span>
00109
00110 <span class="keyword">virtual</span> ioType getInputType(<span class="keywordtype">void</span>) = 0;
00111 <span class="keyword">virtual</span> ioType getOutputType(<span class="keywordtype">void</span>) = 0;
00112 <span class="keyword">virtual</span> nodeType getNodeType(<span class="keywordtype">void</span>) = 0;
00113
00114 <span class="comment">// Name space expansion handling</span>
00115 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> nameSpacesExpanded(<span class="keywordtype">void</span>);
00116 <span class="keyword">virtual</span> <span class="keywordtype">void</span> expandNameSpaces(<span class="keywordtype">void</span>);
00117 <span class="keywordtype">void</span> deleteExpandedNameSpaces(<span class="keywordtype">void</span>);
00118
00119 <span class="comment">// Comment handling</span>
00120
<a name="l00121"></a><a class="code" href="classTXFMBase.html#a9">00121</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> stripComments(<span class="keywordtype">void</span>) { keepComments = <span class="keyword">false</span>;}
00122 <span class="keyword">virtual</span> <span class="keywordtype">void</span> activateComments(<span class="keywordtype">void</span>);
<a name="l00123"></a><a class="code" href="classTXFMBase.html#a11">00123</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> getCommentsStatus(<span class="keywordtype">void</span>) {<span class="keywordflow">return</span> keepComments;}
00124
00125 <span class="comment">// Methods to get output data</span>
00126
00127 <span class="comment">// BinInputStream methods:</span>
00128
00129 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> readBytes(XMLByte * <span class="keyword">const</span> toFill, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> maxToFill) = 0;
00130 <span class="keyword">virtual</span> <a class="code" href="XSECDefs_8hpp.html#a0">XERCES_CPP_NAMESPACE_QUALIFIER</a> DOMDocument *getDocument() = 0;
00131 <span class="keyword">virtual</span> <a class="code" href="XSECDefs_8hpp.html#a0">XERCES_CPP_NAMESPACE_QUALIFIER</a> DOMNode *getFragmentNode() = 0;
00132 <span class="keyword">virtual</span> <span class="keyword">const</span> XMLCh * getFragmentId() = 0;
<a name="l00133"></a><a class="code" href="classTXFMBase.html#a16">00133</a> <span class="keyword">virtual</span> <a class="code" href="classXSECXPathNodeList.html">XSECXPathNodeList</a> & getXPathNodeList() {<span class="keywordflow">return</span> m_XPathMap;}
00134
00135 <span class="comment">// Friends and Statics</span>
00136
<a name="l00137"></a><a class="code" href="classTXFMBase.html#n0">00137</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classTXFMChain.html">TXFMChain</a>;
00138
00139
00140 <span class="keyword">private</span>:
00141
00142 <a class="code" href="classTXFMBase.html">TXFMBase</a>();
00143 };
00144
00147 <span class="preprocessor">#endif </span><span class="comment">/* #define TXFMBASE_INCLUDE */</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Jul 3 17:37:26 2005 for XML-Security-C by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address>
</body>
</html>
|