HDFNode.cc

00001 /*
00002  * $Id: HDFNode.cc,v 1.7 2006/03/29 14:21:35 brook Exp $
00003  */
00004 
00005 /*
00006  * ClearSilver++ Software License.
00007  *
00008  * Copyright (c) 2005,2006 Brook Milligan <brook@nmsu.edu>
00009  * All rights reserved.
00010  * 
00011  * Redistribution and use in source and binary forms, with or without
00012  * modification, are permitted provided that the following conditions
00013  * are met:
00014  * 
00015  * 1. Redistributions of source code must retain the above copyright
00016  *    notice, this list of conditions and the following disclaimer.
00017  * 2. Redistributions in binary form must reproduce the above
00018  *    copyright notice, this list of conditions and the following
00019  *    disclaimer in the documentation and/or other materials provided
00020  *    with the distribution.
00021  * 3. The name of the author may not be used to endorse or promote
00022  *    products derived from this software without specific prior
00023  *    written permission.
00024  * 
00025  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
00026  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00027  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00028  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
00029  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
00031  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00032  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00033  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036  */
00037 
00038 #include "HDFNode.h"
00039 #include <assert.h>
00040 #include "ClearSilverNode.h"
00041 
00042 using namespace std;
00043 
00044                                 // constructors
00045 ClearSilver::HDFNode::HDFNode () {}
00046 ClearSilver::HDFNode::HDFNode (const HDFNode&) {}
00047 ClearSilver::HDFNode::~HDFNode () throw() {}
00048 
00049                                 // assignment
00050 #if 0
00051 ClearSilver::HDFNode&
00052 ClearSilver::HDFNode::operator = (const HDFNode& n)
00053 {
00054   return *this;
00055 }
00056 #endif
00057 
00058                                 // HDF dataset operations
00059 void
00060 ClearSilver::HDFNode::set_value (const char* value)
00061 {
00062   set_value (std::string(value));
00063 }
00064 
00065 void
00066 ClearSilver::HDFNode::set_value (const std::string& value)
00067 {
00068   node().operator = (value);
00069 }
00070 
00071 void
00072 ClearSilver::HDFNode::set_value (int value)
00073 {
00074   node().operator = (value);
00075 }
00076 
00077 void
00078 ClearSilver::HDFNode::set_value (bool value)
00079 {
00080   node().operator = (value);
00081 }
00082 
00083 void
00084 ClearSilver::HDFNode::set_value (const char* key, const char* value)
00085 {
00086   set_value(std::string(key), std::string(value));
00087 }
00088 
00089 void
00090 ClearSilver::HDFNode::set_value (const std::string& key, const std::string& value)
00091 {
00092   node().set_value(key,value);
00093 }
00094 
00095 void
00096 ClearSilver::HDFNode::set_value (const char* key, int value)
00097 {
00098   set_value(std::string(key),value);
00099 }
00100 
00101 void
00102 ClearSilver::HDFNode::set_value (const std::string& key, int value)
00103 {
00104   node().set_value(key,value);
00105 }
00106 
00107 void
00108 ClearSilver::HDFNode::set_value (const char* key, unsigned int value)
00109 {
00110   set_value(std::string(key),value);
00111 }
00112 
00113 void
00114 ClearSilver::HDFNode::set_value (const std::string& key, unsigned int value)
00115 {
00116   node().set_value(key,value);
00117 }
00118 
00119 void
00120 ClearSilver::HDFNode::set_value (const char* key, bool value)
00121 {
00122   set_value(std::string(key),value);
00123 }
00124 
00125 void
00126 ClearSilver::HDFNode::set_value (const std::string& key, bool value)
00127 {
00128   node().set_value(key,value);
00129 }
00130 
00131 void
00132 ClearSilver::HDFNode::read_file (const char* filename)
00133 {
00134   read_file(std::string(filename));
00135 }
00136 
00137 void
00138 ClearSilver::HDFNode::read_file (const std::string& filename)
00139 {
00140   node().read_file(filename);
00141 }
00142 
00143                                 // sort the children
00144 void
00145 ClearSilver::HDFNode::sort (ClearSilverNodeComparator::Ptr c)
00146 {
00147   node().sort (c);
00148 }
00149 
00150 
00151                                 // delete subtree methods
00152                                 // remove the subtree rooted at path.
00153 void
00154 ClearSilver::HDFNode::remove_tree (const char * key)
00155 {
00156   remove_tree(std::string(key));
00157 }
00158 
00159                                 // remove the subtree rooted at path.
00160 void
00161 ClearSilver::HDFNode::remove_tree (const std::string& key)
00162 {
00163   node().remove_tree(key);
00164 }
00165 
00166 void
00167 ClearSilver::HDFNode::remove_tree (HDF& hdf)
00168 {
00169   assert (0);                   // XXX - unimplemented for now
00170 }
00171 
00172 void
00173 ClearSilver::HDFNode::remove_cgi ()
00174 {
00175   remove_tree ("CGI");
00176   remove_tree ("Cookie");
00177   remove_tree ("HTTP");
00178   remove_tree ("Query");
00179 }
00180 
00181 void
00182 ClearSilver::HDFNode::swap (HDFNode&) throw()
00183 {}
00184 
00185                                 // debug flag
00186 bool&
00187 ClearSilver::HDFNode::debug ()
00188 {
00189   static bool debug_ = false;
00190   return debug_;
00191 }
00192 

Generated on Tue May 16 14:50:52 2006 for ClearSilver C++ Library by  doxygen 1.4.5