libHiRISE
|
#include <string>
#include <vector>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <libgen.h>
#include "Observation_ID.hh"
Enumerations | |
enum | Exit_Code { SUCCESS = 0, BAD_ID, THREW_INVALID_ARGUMENT_EXCEPTION, THREW_OTHER_EXCEPTION, THREW_UNKNOWN_EXCEPTION } |
Functions | |
int | main (int argument_count, char **arguments) |
A command-line application to generate observation IDs from text. | |
Variables | |
static const char * | ID = "Make_Observation_ID (2.6, 2020/02/14 00:58:12)" |
enum Exit_Code |
int main | ( | int | argument_count, |
char ** | arguments | ||
) |
A command-line application to generate observation IDs from text.
Make_Observation_ID [-Dec] [-HEX] [-No_newline] id_1 [id_2 ...]
Make_Observation_ID -Version
Make_Observation_ID [-Help]
Make_Observation_ID
generates one or more observation IDs based on command-line input. Each non-switch argument is parsed in an attempt to extract an observation ID. Potential observation IDs may be of the following forms:
0x
or 0X
. 0x
or 0X
. "Embedded" means the text can be found within additional text, provided the text is one single argument. For example, ID=CRU_000027_1000
contains an embedded in-orbit observation ID, CRU_000027_1000
.
Non-switch arguments that are identified as observation IDs are reported to the standard output stream in their conventional text form after parsing is complete. Optional switches control the form of the output somewhat. By default, only the text form is reported, followed by a newline character. The newline may be surpressed, and the decimal form or the hex form of the ID may also be reported.
Non-switch arguments that cannot be identified as observation IDs are reported to the standard error stream after parsing is complete. If such bad arguments are found, the application exits with a non-zero exit status.
The following options are not case-sensitive. They may be reduced to the character sequence indicated in uppercase for simplicity's sake.
Make_Observation_ID
and the Observation_ID
class to standard output stream and exit with success. If no arguments are supplied to the application, the help statement is reported on the standard output stream and the application exits with success.
Make_Observation_ID
exits with one of the following statuses, depending on the circumstances of its processing. All error messages are written to the standard error stream.
References BAD_ID, ID, SUCCESS, and Observation_ID::value().
const char* ID = "Make_Observation_ID (2.6, 2020/02/14 00:58:12)" [static] |
Referenced by Channel_ID::channel_number(), CCD_ID::cpmm_number(), Exception::Exception(), Instrument::focal_plane_x_offset(), Observation_ID::hex_value(), main(), Observation_ID::mission_phase(), Observation_ID::orbit_number(), Observation_ID::parse(), Observation_ID::target(), Observation_ID::time(), and Observation_ID::value().