HDFNode.h

Go to the documentation of this file.
00001 /* -*- c++ -*-
00002  * $Id: HDFNode.h,v 1.11 2006/05/16 20:06:34 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 
00043 #ifndef HDFNode_h_
00044 #define HDFNode_h_ 1
00045 
00046 #include <string>
00047 #include "ClearSilverNodeComparator.h"
00048 
00049 namespace ClearSilver
00050 {
00051   class ClearSilverNode;        // forward declarations
00052   class HDF;            
00053 
00061   class HDFNode
00062   {
00063   public:
00064     typedef std::string Name;
00065 
00066   private:
00067                                 // unimplemented assignment
00068     HDFNode& operator = (const HDFNode&);
00069 
00070   protected:
00072     void swap (HDFNode&) throw();
00073     virtual void push (const Name&, const ClearSilverNode&) = 0;
00074     virtual void pop () = 0;
00075     virtual ClearSilverNode top () const = 0;
00076 
00077   public:
00079     //\{
00081     HDFNode ();
00083     HDFNode (const HDFNode&);
00085     ~HDFNode () throw();
00086     //\}
00087 
00089     virtual ClearSilverNode node () const = 0;
00090 
00100     //\{
00101     void set_value (const char* value);
00102     void set_value (const std::string& value);
00103     void set_value (int value);
00104     void set_value (bool value);
00105     void set_value (const char* key, const char* value);
00106     void set_value (const std::string& key, const std::string& value);
00107     void set_value (const char* key, int value);
00108     void set_value (const std::string& key, int value);
00109     void set_value (const char* key, unsigned int value);
00110     void set_value (const std::string& key, unsigned int value);
00111     void set_value (const char* key, bool value);
00112     void set_value (const std::string& key, bool value);
00113 
00114     void read_file (const char* filename);
00115     void read_file (const std::string& filename);
00116     //\}
00117 
00119     void sort (ClearSilverNodeComparator::Ptr);
00120 
00127     //\{
00129     void remove_tree (const char* key);
00131     void remove_tree (const std::string& key);
00133     void remove_tree (HDF&);
00142     void remove_cgi ();
00143     //\}
00144 
00151     static bool& debug ();
00152   };
00153 };                              // namespace ClearSilver
00154 
00155 #endif

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