Sub-module for parsing of input 'string values' as various 'types' (as defined in Header UserInput.h).
Prototypes | |
int | XLALParseStringValueAsINT4PlusFrac (INT4 *valINT4, REAL8 *valFrac, const char *valString) |
Parse a string containing a floating-point number into integer and fractional part, such that val = valINT + valFrac. More... | |
int | XLALParseStringValueAsINT8 (INT8 *valINT8, const char *valString) |
Parse a string into an INT8 This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace) More... | |
int | XLALParseStringValueAsINT4 (INT4 *valINT4, const char *valString) |
Parse a string into an INT4 This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace) More... | |
int | XLALParseStringValueAsUINT8 (UINT8 *valUINT8, const char *valString) |
Parse a string into an UINT8 This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace) More... | |
int | XLALParseStringValueAsUINT4 (UINT4 *valUINT4, const char *valString) |
Parse a string into an UINT4 This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace) More... | |
int | XLALParseStringValueAsREAL8 (REAL8 *valREAL8, const char *valString) |
Parse a string into a REAL8 This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace) More... | |
int | XLALParseStringValueAsREAL4 (REAL4 *valREAL4, const char *valString) |
Parse a string into a REAL4. More... | |
int | XLALParseStringValueAsBOOLEAN (BOOLEAN *valBOOLEAN, const char *valString) |
Parse a string into a BOOLEAN Allowed string-values are (case-insensitive): {"yes", "true", "1"} --> TRUE {"no", "false", "0"} --> FALSE. More... | |
int | XLALParseStringValueAsGPS (LIGOTimeGPS *gps, const char *valString) |
Parse a string representing a GPS time into LIGOTimeGPS, without loss of (ns) accuracy. More... | |
int | XLALParseStringValueAsEPOCH (LIGOTimeGPS *gps, const char *valString) |
Parse a string representing an 'epoch' into an LIGOTimeGPS, allowing both GPS and MJD(TT) inputs, at ns accuracy. More... | |
int | XLALParseStringValueAsRAJ (REAL8 *valRAJ, const char *valString) |
Parse a string representing an 'equatorial longitude' (aka right ascension or RA) into REAL8 radians, allowing for both radians or "hours:minutes:seconds" as input. More... | |
int | XLALParseStringValueAsDECJ (REAL8 *valDECJ, const char *valString) |
Parse a string representing an 'equatorial latitude' (aka declination or DEC) into REAL8 radians, allowing for both radians or "degrees:minutes:seconds" as input. More... | |
int | XLALParseStringValueAsINT4Range (INT4Range int4Range, const char *valString) |
Parse a string representing a range of INT4 values into a INT4Range. More... | |
int | XLALParseStringValueAsREAL8Range (REAL8Range real8Range, const char *valString) |
Parse a string representing a range of REAL8 values into a REAL8Range. More... | |
int | XLALParseStringValueAsEPOCHRange (LIGOTimeGPSRange gpsRange, const char *valString) |
Parse a string representing a range of LIGOTimeGPS values into a LIGOTimeGPSRange. More... | |
int | XLALParseStringValueAsRAJRange (REAL8Range rajRange, const char *valString) |
Parse a string representing a range of RAJ values into a REAL8Range. More... | |
int | XLALParseStringValueAsDECJRange (REAL8Range decjRange, const char *valString) |
Parse a string representing a range of DECJ values into a REAL8Range. More... | |
int | XLALParseStringValueAsUserEnum (int *valEnum, const UserChoices *enumData, const char *valString) |
Parse a string representing a user selection of an enumeration value. More... | |
int | XLALParseStringValueAsUserFlag (int *valFlag, const UserChoices *flagData, const char *valString) |
Parse a string representing a user selection of a set of bitflags. More... | |
int | XLALParseStringValueAsSTRING (CHAR **valOut, const char *valString) |
Duplicate string 'in', removing surrounding quotes " or \' if present. More... | |
int | XLALParseStringValueAsSTRINGVector (LALStringVector **valSTRINGVector, const CHAR *valString) |
Parse a string containing a list of comma-separated values (CSV) into a StringVector. More... | |
DECL_XLALParseStringValueAsVector (INT4) | |
DECL_XLALParseStringValueAsVector (UINT4) | |
DECL_XLALParseStringValueAsVector (REAL8) | |
Data Structures | |
struct | UserChoices |
Possible choices the user may select for an enumeration or bitflag. More... | |
Typedefs | |
typedef REAL8 | REAL8Range[2] |
A range of REAL8 values; first element is minimum, second element is maximum of range. More... | |
typedef INT4 | INT4Range[2] |
A range of INT4 values; first element is minimum, second element is maximum of range. More... | |
typedef LIGOTimeGPS | LIGOTimeGPSRange[2] |
A range of GPS times; first element is minimum, second element is maximum of range. More... | |
Macros | |
#define | XLAL_IDX2BIT(i) (1UL << ((unsigned long)(i))) |
Convert an unsigned long index i into a bit, i.e. More... | |
#define | XLAL_BIT2IDX(b) |
Convert an unsigned long single bit b into an index, i.e. More... | |
#define | DECL_XLALParseStringValueAsVector(CTYPE) int XLALParseStringValueAs ##CTYPE## Vector ( CTYPE ## Vector **vect, const CHAR *valString ) |
Parse a string containing a floating-point number into integer and fractional part, such that val = valINT + valFrac.
This is useful for parsing strings representing GPS or MJD times wihout loss of ns accuracy.
[out] | valINT4 | return INT4 integer part 'xxx' |
[out] | valFrac | return fractional part '0.yyyy' |
[in] | valString | input string value representing a floating-point number "xxx.yyyy" |
Definition at line 203 of file UserInputParse.c.
int XLALParseStringValueAsINT8 | ( | INT8 * | valINT8, |
const char * | valString | ||
) |
Parse a string into an INT8 This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace)
[out] | valINT8 | return INT8 value |
[in] | valString | input string value |
Definition at line 50 of file UserInputParse.c.
int XLALParseStringValueAsINT4 | ( | INT4 * | valINT4, |
const char * | valString | ||
) |
Parse a string into an INT4 This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace)
[out] | valINT4 | return INT4 value |
[in] | valString | input string value |
Definition at line 79 of file UserInputParse.c.
int XLALParseStringValueAsUINT8 | ( | UINT8 * | valUINT8, |
const char * | valString | ||
) |
Parse a string into an UINT8 This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace)
[out] | valUINT8 | return UINT8 value |
[in] | valString | input string value |
Definition at line 102 of file UserInputParse.c.
int XLALParseStringValueAsUINT4 | ( | UINT4 * | valUINT4, |
const char * | valString | ||
) |
Parse a string into an UINT4 This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace)
[out] | valUINT4 | return UINT4 value |
[in] | valString | input string value |
Definition at line 135 of file UserInputParse.c.
int XLALParseStringValueAsREAL8 | ( | REAL8 * | valREAL8, |
const char * | valString | ||
) |
Parse a string into a REAL8 This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace)
[out] | valREAL8 | return REAL8 value |
[in] | valString | input string value |
Definition at line 158 of file UserInputParse.c.
int XLALParseStringValueAsREAL4 | ( | REAL4 * | valREAL4, |
const char * | valString | ||
) |
Parse a string into a REAL4.
This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace)
[out] | valREAL4 | return REAL4 value |
[in] | valString | input string value |
Definition at line 179 of file UserInputParse.c.
int XLALParseStringValueAsBOOLEAN | ( | BOOLEAN * | valBOOLEAN, |
const char * | valString | ||
) |
Parse a string into a BOOLEAN Allowed string-values are (case-insensitive): {"yes", "true", "1"} --> TRUE {"no", "false", "0"} --> FALSE.
NOTE: This throws an error on any extraneous leading or trailing characters or whitespace
[out] | valBOOLEAN | return BOOLEAN value |
[in] | valString | input string value |
Definition at line 248 of file UserInputParse.c.
int XLALParseStringValueAsGPS | ( | LIGOTimeGPS * | gps, |
const char * | valString | ||
) |
Parse a string representing a GPS time into LIGOTimeGPS, without loss of (ns) accuracy.
[out] | gps | returned GPS time |
[in] | valString | input string representing MJD(TT) time |
Definition at line 287 of file UserInputParse.c.
int XLALParseStringValueAsEPOCH | ( | LIGOTimeGPS * | gps, |
const char * | valString | ||
) |
Parse a string representing an 'epoch' into an LIGOTimeGPS, allowing both GPS and MJD(TT) inputs, at ns accuracy.
Allowed input string formats are "INT4.INT4[GPS|MJD]", where the optional postfix 'GPS' or 'MJD' indicates the time 'units', which defaults to GPS if no postfix is given. Note that MJD input is interpreted as MJD(TT), and translated into GPS using XLALTranslateStringMJDTTtoGPS(). This ignores initial whitespace, but throws an error on any non-converted trailing characters (including whitespace)
[out] | gps | return LIGOTimeGPS value |
[in] | valString | input string value |
Definition at line 314 of file UserInputParse.c.
int XLALParseStringValueAsRAJ | ( | REAL8 * | valRAJ, |
const char * | valString | ||
) |
Parse a string representing an 'equatorial longitude' (aka right ascension or RA) into REAL8 radians, allowing for both radians or "hours:minutes:seconds" as input.
Note that "h:m:s" input is translated into radians using XLALTranslateHMStoRAD().
[out] | valRAJ | return longitude value in radians |
[in] | valString | input string value |
Definition at line 365 of file UserInputParse.c.
int XLALParseStringValueAsDECJ | ( | REAL8 * | valDECJ, |
const char * | valString | ||
) |
Parse a string representing an 'equatorial latitude' (aka declination or DEC) into REAL8 radians, allowing for both radians or "degrees:minutes:seconds" as input.
Note that "d:m:s" input is translated into radians using XLALTranslateDMStoRAD().
[out] | valDECJ | return latitude value in radians |
[in] | valString | input string value |
Definition at line 392 of file UserInputParse.c.
int XLALParseStringValueAsINT4Range | ( | INT4Range | int4Range, |
const char * | valString | ||
) |
Parse a string representing a range of INT4 values into a INT4Range.
Possible formats are start
, start,end
, start/band
, or start~plusminus
. Output range is always low,high
with range[0] = low; range[1] = high
.
[out] | int4Range | output range of INT4 values |
[in] | valString | input string |
Definition at line 510 of file UserInputParse.c.
int XLALParseStringValueAsREAL8Range | ( | REAL8Range | real8Range, |
const char * | valString | ||
) |
Parse a string representing a range of REAL8 values into a REAL8Range.
Possible formats are start
, start,end
, start/band
, or start~plusminus
. Output range is always low,high
with range[0] = low; range[1] = high
.
[out] | real8Range | output range of REAL8 values |
[in] | valString | input string |
Definition at line 473 of file UserInputParse.c.
int XLALParseStringValueAsEPOCHRange | ( | LIGOTimeGPSRange | gpsRange, |
const char * | valString | ||
) |
Parse a string representing a range of LIGOTimeGPS values into a LIGOTimeGPSRange.
Possible formats are start
, start,end
, start/band
, or start~plusminus
. Output range is always low,high
with range[0] = low; range[1] = high
.
[out] | gpsRange | output range of LIGOTimeGPS values |
[in] | valString | input string |
Definition at line 548 of file UserInputParse.c.
int XLALParseStringValueAsRAJRange | ( | REAL8Range | rajRange, |
const char * | valString | ||
) |
Parse a string representing a range of RAJ values into a REAL8Range.
Possible formats are start
, start,end
, start/band
, or start~plusminus
. Output range is always low,high
with range[0] = low; range[1] = high
.
[out] | rajRange | output range of RAJ values |
[in] | valString | input string |
Definition at line 586 of file UserInputParse.c.
int XLALParseStringValueAsDECJRange | ( | REAL8Range | decjRange, |
const char * | valString | ||
) |
Parse a string representing a range of DECJ values into a REAL8Range.
Possible formats are start
, start,end
, start/band
, or start~plusminus
. Output range is always low,high
with range[0] = low; range[1] = high
.
[out] | decjRange | output range of DECJ values |
[in] | valString | input string |
Definition at line 624 of file UserInputParse.c.
int XLALParseStringValueAsUserEnum | ( | int * | valEnum, |
const UserChoices * | enumData, | ||
const char * | valString | ||
) |
Parse a string representing a user selection of an enumeration value.
[out] | valEnum | output enumeration value |
[in] | enumData | possible choices for enumeration values |
[in] | valString | input string value |
Definition at line 662 of file UserInputParse.c.
int XLALParseStringValueAsUserFlag | ( | int * | valFlag, |
const UserChoices * | flagData, | ||
const char * | valString | ||
) |
Parse a string representing a user selection of a set of bitflags.
[out] | valFlag | output bitflag value |
[in] | flagData | possible choices for bitflag values |
[in] | valString | input string value |
Definition at line 695 of file UserInputParse.c.
Duplicate string 'in', removing surrounding quotes " or \' if present.
[out] | out | return allocated string |
[in] | valStr | input string value |
Definition at line 757 of file UserInputParse.c.
int XLALParseStringValueAsSTRINGVector | ( | LALStringVector ** | strVect, |
const CHAR * | valString | ||
) |
Parse a string containing a list of comma-separated values (CSV) into a StringVector.
[out] | strVect | allocated string vector |
[in] | valString | input string value |
Definition at line 805 of file UserInputParse.c.
DECL_XLALParseStringValueAsVector | ( | INT4 | ) |
DECL_XLALParseStringValueAsVector | ( | UINT4 | ) |
DECL_XLALParseStringValueAsVector | ( | REAL8 | ) |
typedef REAL8 REAL8Range[2] |
A range of REAL8 values; first element is minimum, second element is maximum of range.
Definition at line 61 of file UserInputParse.h.
typedef INT4 INT4Range[2] |
A range of INT4 values; first element is minimum, second element is maximum of range.
Definition at line 66 of file UserInputParse.h.
typedef LIGOTimeGPS LIGOTimeGPSRange[2] |
A range of GPS times; first element is minimum, second element is maximum of range.
Definition at line 71 of file UserInputParse.h.
#define XLAL_IDX2BIT | ( | i | ) | (1UL << ((unsigned long)(i))) |
Convert an unsigned long index i
into a bit, i.e.
\(b = 2^i\)
Definition at line 44 of file UserInputParse.h.
#define XLAL_BIT2IDX | ( | b | ) |
Convert an unsigned long single bit b
into an index, i.e.
\(i = \log_2 b \)
Definition at line 49 of file UserInputParse.h.
#define DECL_XLALParseStringValueAsVector | ( | CTYPE | ) | int XLALParseStringValueAs ##CTYPE## Vector ( CTYPE ## Vector **vect, const CHAR *valString ) |
Definition at line 118 of file UserInputParse.h.