libdap  Updated for version 3.20.6
libdap4 is an implementation of OPeNDAP's DAP protocol.
libdap::Ancillary Class Reference

Static Public Member Functions

static string find_ancillary_file (const string &pathname, const string &ext, const string &dir, const string &file)
 Find a file with ancillary data. More...
 
static string find_group_ancillary_file (const string &pathname, const string &ext)
 
static void read_ancillary_das (DAS &das, const string &pathname, const string &dir="", const string &file="")
 
static void read_ancillary_dds (DDS &dds, const string &pathname, const string &dir="", const string &file="")
 

Detailed Description

Definition at line 46 of file Ancillary.h.

Member Function Documentation

◆ find_ancillary_file()

string libdap::Ancillary::find_ancillary_file ( const string &  pathname,
const string &  ext,
const string &  dir,
const string &  file 
)
static

Find a file with ancillary data.

This function accepts a dataset path name, and searches for a matching ancillary data file name with a very specific set of search rules, given here:

directory           filename          extension
same                same            `.'given
given               same            `.'given
same                given           `.'given
given               given           `.'given

Where same'' refers to the input dataset pathname, andgiven'' refers to the function arguments.

For example, If you call this function with a dataset name of /a/data, an extension of das, a directory of b, and a filename of ralph, the function will look (in order) for the following files:

/a/data.das
/b/data.das
/a/ralph.das
/b/ralph.das

The function will return a string containing the name of the first file in the list that exists, if any.

Note
This code now checks for pathname.ext 3/17/99 jhrg
Parameters
pathnameThe input pathname of a dataset.
extThe input extension the desired file is to have.
dirThe input directory in which the desired file may be found.
fileThe input filename the desired file may have.
Returns
A string containing the pathname of the file found by searching with the given components. If no file was found, the null string is returned.

Definition at line 69 of file Ancillary.cc.

◆ find_group_ancillary_file()

string libdap::Ancillary::find_group_ancillary_file ( const string &  name,
const string &  ext 
)
static

Assume that name refers to a file that is one of a group of files which share a common `base' name and differ only by some prefix or suffix digits (e.g. 00base, 01base, ... or base00, ... have the base name base). This function looks for a file base.ext.

Parameters
nameThe name (full or relative) to one member of a group of files.
extThe extension of the group's ancillary file. Note that ext should include a period (.) if that needs to separate the base name from the extension.
Returns
The pathname to the group's ancillary file if found, otherwise the empty string ("").

Definition at line 138 of file Ancillary.cc.


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