Public Member Functions

HDFFileMetaData Class Reference

#include <hdffilemetadata.h>

Collaboration diagram for HDFFileMetaData:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HDFFileMetaData (const Hdf_file *_hdf_file=NULL)
 HDFFileMetaData (const char *_hdf_file_name=NULL)
 HDFFileMetaData (const std::string &_hdf_file_name=NULL)
 ~HDFFileMetaData ()
void to_xml (const char *output_filename=NULL, const bool overwrite=false)
void get_value (void *val, const char *tag_name="GRANULEID")
const bool get_tree_value (void *val, const string &tag_name)
const bool get_tree_value_string (string &val, const string &tag_name)
void view_tree ()

Detailed Description

Give methods to read and access to the metadata of an HDF file. For that, build a tree with those metadata.

Author:
Nicolas PASCAL

Constructor & Destructor Documentation

HDFFileMetaData::HDFFileMetaData ( const Hdf_file *  _hdf_file = NULL  ) 

Constructor

Parameters:
_hdf_file a pointer to an hdf file instance
HDFFileMetaData::HDFFileMetaData ( const char *  _hdf_file_name = NULL  ) 

Constructor

Parameters:
_hdf_file_name the hdf file to read
HDFFileMetaData::HDFFileMetaData ( const std::string &  _hdf_file_name = NULL  ) 

Constructor

Parameters:
_hdf_file_name the hdf file to read
HDFFileMetaData::~HDFFileMetaData (  ) 

Destructor


Member Function Documentation

const bool HDFFileMetaData::get_tree_value ( void *  val,
const string &  tag_name 
)

find the first node in the metadata tree having the tag "tag_name". In fact, it finds the first leaf that is child of the node called tag_name.

Parameters:
val the value to write (must be of the good type)
tag_name the tag we are searching for the value
Returns:
true if the value was found
const bool HDFFileMetaData::get_tree_value_string ( string &  val,
const string &  tag_name 
)

find the first node in the metadata tree having the tag "tag_name". In fact, it finds the first leaf that is child of the node called tag_name.

Parameters:
val the value to write
tag_name the tag we are searching for the value
Returns:
true if the value was found
void HDFFileMetaData::get_value ( void *  val,
const char *  tag_name = "GRANULEID" 
)

Permit to retrieve a metadata value using a tag_name. It returns the value of the first crossed tag with this name.

Parameters:
tag_name the tag name of the node
val the searched value, or NULL in case of problem

Referenced by MODISFileData::set_gring(), MODISFileData::set_lat_lon_min_max(), and CALIOPFileData::set_lat_lon_min_max().

void HDFFileMetaData::to_xml ( const char *  output_filename = NULL,
const bool  overwrite = false 
)

Dump the metadata to an XML file

Parameters:
output_filename the name of the output xml file. If not given, add the extension, and if NULL, build the output name with the pattern : "input_file_without_extension"+".xml"
overwrite when true, if the output file already exists, overwrite it. (and so, if false, don't)
void HDFFileMetaData::view_tree (  ) 

print out the build tree


The documentation for this class was generated from the following files: