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.
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 45 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, and`given'' 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

  pathname | The input pathname of a dataset.
  ext | The input extension the desired file is to have.
  dir | The input directory in which the desired file may be found.
  file | The 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 68 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

  name | The name (full or relative) to one member of a group of files.
  ext | The 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 131 of file Ancillary.cc.

## read_ancillary_das()

void libdap::Ancillary::read_ancillary_das | ( | DAS & | das,
|  | const string & | pathname,
|  | const string & | dir = `""`,
|  | const string & | file = `""`
| ) |  |

static

Definition at line 185 of file Ancillary.cc.

## read_ancillary_dds()

void libdap::Ancillary::read_ancillary_dds | ( | DDS & | dds,
|  | const string & | pathname,
|  | const string & | dir = `""`,
|  | const string & | file = `""`
| ) |  |

static

Definition at line 197 of file Ancillary.cc.

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

- Ancillary.h
- Ancillary.cc