00001 00002 /* 00003 | Author: Michael Schmidt; 00004 | Gunnar Jehl 00005 | 00006 | ************************* SOFTWARE LICENSE AGREEMENT *********************** 00007 | This source code is published under the BSD License. 00008 | 00009 | See file 'LICENSE.txt' that comes with this distribution or 00010 | http://dbis.informatik.uni-freiburg.de/index.php?project=GCX/license.php 00011 | for the full license agreement. 00012 | 00013 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00014 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00015 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00016 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00017 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00018 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00019 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00020 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00021 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00022 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00023 | POSSIBILITY OF SUCH DAMAGE. 00024 | **************************************************************************** 00025 */ 00026 00035 #include "pathstepnodeexpression.h" 00036 00037 PathStepNodeExpression:: 00038 PathStepNodeExpression(AXIS_TYPE _axis):PathStepExpression(et_pathstepnode, 00039 _axis, NULL) { 00040 } 00041 00042 PathStepNodeExpression::PathStepNodeExpression(AXIS_TYPE _axis, 00043 PathStepAttribute * 00044 _attribute):PathStepExpression 00045 (et_pathstepnode, _axis, _attribute) { 00046 } 00047 00048 PathStepNodeExpression::PathStepNodeExpression(): 00049 PathStepExpression(et_pathstepnode, at_child, NULL) { 00050 } 00051 00052 PathStepNodeExpression::~PathStepNodeExpression() { 00053 } 00054 00055 void PathStepNodeExpression::print(OutputStream & dos) const { 00056 switch (axis) { 00057 case at_child: 00058 dos << "/"; 00059 break; 00060 case at_descendant: 00061 dos << "//"; 00062 break; 00063 case at_dos: 00064 dos << "/dos::"; 00065 break; 00066 } 00067 dos << "node()"; 00068 if (attribute) { 00069 dos << *(attribute); 00070 } 00071 } 00072 00073 PathStepNodeExpression *PathStepNodeExpression::clone() { 00074 if (attribute) { 00075 return new PathStepNodeExpression(axis, attribute->clone()); 00076 } else { 00077 return new PathStepNodeExpression(axis); 00078 } 00079 } 00080 00081 PathStepNodeExpression *PathStepNodeExpression::cloneWithoutAttributes() { 00082 return new PathStepNodeExpression(axis); 00083 }