00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Nicolas PASCAL * 00003 * nicolas.pascal@icare.univ-lille1.fr * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #ifndef HDFMETADATANODE_H 00021 #define HDFMETADATANODE_H 00022 00023 #include <string> 00024 #include <vector> 00025 #include <iostream> 00026 00027 using namespace std; 00028 00039 class HDFMetadataNode { 00040 public: 00045 enum value_type{ 00046 BAD,STRING,INTEGER,FLOAT,ARRAY_INTEGER,ARRAY_FLOAT,ARRAY_STRING, 00047 }; 00051 HDFMetadataNode(); 00057 HDFMetadataNode(void* _value, HDFMetadataNode::value_type _typecode); 00061 ~HDFMetadataNode(); 00066 void set_next_sibling(HDFMetadataNode* val); 00071 HDFMetadataNode* get_next_sibling() const; 00076 void set_child(HDFMetadataNode* val); 00081 HDFMetadataNode* get_child() const; 00085 void print_val() const; 00090 const bool is_leaf() const; 00095 void read_node_value(void* val = NULL); 00100 HDFMetadataNode::value_type get_typecode() const; 00105 void* get_value() const; 00106 private: 00107 // the value of the node. If pure Node, NULL 00108 void* value; 00109 HDFMetadataNode::value_type typecode; 00110 HDFMetadataNode* next_sibling; 00111 HDFMetadataNode* child; 00112 }; 00113 00114 #endif