/*************************************************************************** * Copyright (C) 2006 by Nicolas PASCAL * * nicolas.pascal@icare.univ-lille1.fr * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "Hdf_vd.hpp" void Hdf_vd::init_fields( const int32 &id, const char *field_name_list, const int32 & nb_field ) { // read the field names string s_field_name_list(field_name_list); int previous_comma_idx=-1; int next_comma_idx=0; int32 type, order, size; // initialize new field infos Hdf_vd_field new_field; // read the fields infos for (int32 i=0;i=(int32)attrs.size()) { bad_attribute_index e(name,attr_idx,VDATA); throw e; } return attrs[attr_idx]; } const bool Hdf_vd::has_attr( const char * attr_name ) const { return ( get_attr_idx(attr_name)!=-1 ); } int32 Hdf_vd::get_field_idx( const char * field_name ) const { int32 i=0; int32 end=fields.size(); while (i=(int32)fields.size()) { bad_field_index e(name,field_idx); throw e; } return fields[field_idx]; } const bool Hdf_vd::has_field( const char * field_name ) const { return ( get_field_idx(field_name)!=-1 ); } void Hdf_vd::get_attr_value( const char * attr_name, void * value, int32 ival ) const { Hdf_attr attr = get_attribute(attr_name); // throw a bad_attribute_name if the attribute doesn't exist attr.get_value(value,ival); } std::string Hdf_vd::to_string() const { using namespace std; ostringstream s; s << name << ", class: " << cls << ", interlace: " << interlace <<", nb_record: " <0) { s<<"***** VDATA Fields *****"<0) { cout<<"***** VDATA Attributes *****"<