PCL
Sexagesimal String Representation and Parsing

Classes

struct  pcl::AngleConversionOptions
 A set of options specific for string representations of angles. More...
 
struct  pcl::DecConversionOptions
 A set of options specific for string representations of declination angles. More...
 
struct  pcl::LatitudeConversionOptions
 A set of options specific for string representations of latitude angles. More...
 
struct  pcl::LongitudeConversionOptions
 A set of options specific for string representations of longitude angles. More...
 
struct  pcl::RAConversionOptions
 A set of options specific for string representations of right ascensions. More...
 
struct  pcl::SexagesimalConversionOptions
 Formatting options for string sexagesimal representations. More...
 

Functions

void pcl::IsoString::ParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const Array< char_type > &separators) const
 
void pcl::String::ParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const Array< char_type > &separators) const
 
void pcl::IsoString::ParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const IsoString &separator=':') const
 
void pcl::String::ParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const String &separator=':') const
 
double pcl::IsoString::SexagesimalToDouble (const Array< char_type > &separators) const
 
double pcl::String::SexagesimalToDouble (const Array< char_type > &separators) const
 
double pcl::IsoString::SexagesimalToDouble (const IsoString &separator=':') const
 
double pcl::String::SexagesimalToDouble (const String &separator=':') const
 
static IsoString pcl::IsoString::ToSexagesimal (double d, const SexagesimalConversionOptions &options=SexagesimalConversionOptions())
 
static String pcl::String::ToSexagesimal (double d, const SexagesimalConversionOptions &options=SexagesimalConversionOptions())
 
static IsoString pcl::IsoString::ToSexagesimal (int sign, double s1, double s2, double s3, const SexagesimalConversionOptions &options=SexagesimalConversionOptions())
 
static String pcl::String::ToSexagesimal (int sign, double s1, double s2, double s3, const SexagesimalConversionOptions &options=SexagesimalConversionOptions())
 
bool pcl::IsoString::TryParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const Array< char_type > &separators) const noexcept
 
bool pcl::String::TryParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const Array< char_type > &separators) const noexcept
 
bool pcl::IsoString::TryParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const IsoString &separator=':') const noexcept
 
bool pcl::String::TryParseSexagesimal (int &sign, int &s1, int &s2, double &s3, const String &separator=':') const noexcept
 
bool pcl::IsoString::TrySexagesimalToDouble (double &value, const Array< char_type > &separators) const noexcept
 
bool pcl::String::TrySexagesimalToDouble (double &value, const Array< char_type > &separators) const noexcept
 
bool pcl::IsoString::TrySexagesimalToDouble (double &value, const IsoString &separator=':') const noexcept
 
bool pcl::String::TrySexagesimalToDouble (double &value, const String &separator=':') const noexcept
 

Detailed Description

Function Documentation

◆ ParseSexagesimal() [1/4]

void pcl::IsoString::ParseSexagesimal ( int &  sign,
int &  s1,
int &  s2,
double &  s3,
const Array< char_type > &  separators 
) const

Evaluates this string as a sexagesimal numeric literal representation, using the specified set of separators, and stores the resulting components in the specified sign, s1, s2 and s3 variables.

This function is identical to ParseSexagesimal( int&, int&, int&, double&, const IsoString& ), but a set of separator characters is specified as a dynamic array. Any occurrence of a character contained by separators will be valid as a token separator.

See also
TryParseSexagesimal( int&, int&, int&, double&, const Array<>& )

◆ ParseSexagesimal() [2/4]

void pcl::String::ParseSexagesimal ( int &  sign,
int &  s1,
int &  s2,
double &  s3,
const Array< char_type > &  separators 
) const

Evaluates this string as a sexagesimal numeric literal representation, using the specified set of separators, and stores the resulting components in the specified sign, s1, s2 and s3 variables.

This function is identical to ParseSexagesimal( int&, int&, int&, double&, const String& ), but a set of separator characters is specified as a dynamic array. Any occurrence of a character contained by separators will be valid as a token separator.

See also
TryParseSexagesimal( int&, int&, int&, double&, const Array<>& )

◆ ParseSexagesimal() [3/4]

void pcl::IsoString::ParseSexagesimal ( int &  sign,
int &  s1,
int &  s2,
double &  s3,
const IsoString separator = ':' 
) const

Evaluates this string as a sexagesimal numeric literal representation, using the specified separator, and stores the resulting components in the specified sign, s1, s2 and s3 variables.

The output value of sign is either -1 or +1, respectively for negative and positive values.

For information about the legal syntax of a sexagesimal literal, see the documentation for SexagesimalToDouble().

This function stores canonical minutes and seconds components, irrespective of the actual component values represented by this string. The output sexagesimal component values are such that:

0 ≤ s1
0 ≤ s2 < 60
0 ≤ s3 < 60
If this string doesn't contain a valid sexagesimal numeric literal, or if the range of double is exceeded, this member function throws a ParseError exception.

See also
TryParseSexagesimal(), SexagesimalToDouble(), TrySexagesimalToDouble()

◆ ParseSexagesimal() [4/4]

void pcl::String::ParseSexagesimal ( int &  sign,
int &  s1,
int &  s2,
double &  s3,
const String separator = ':' 
) const

Evaluates this string as a sexagesimal numeric literal representation, using the specified separator, and stores the resulting components in the specified sign, s1, s2 and s3 variables.

The output value of sign is either -1 or +1, respectively for negative and positive values.

For information about the legal syntax of a sexagesimal literal, see the documentation for SexagesimalToDouble().

This function stores canonical minutes and seconds components, irrespective of the actual component values represented by this string. The output sexagesimal component values are such that:

0 ≤ s1
0 ≤ s2 < 60
0 ≤ s3 < 60
If this string doesn't contain a valid sexagesimal numeric literal, or if the range of double is exceeded, this member function throws a ParseError exception.

See also
TryParseSexagesimal(), SexagesimalToDouble(), TrySexagesimalToDouble()

◆ SexagesimalToDouble() [1/4]

double pcl::IsoString::SexagesimalToDouble ( const Array< char_type > &  separators) const
inline

Evaluates this string as a sexagesimal numeric literal representation with the specified set of separators, and returns the result as a double value.

This function is identical to SexagesimalToDouble( const IsoString& ), but a set of separator characters is specified as a dynamic array. Any occurrence of a character contained by separators will be valid as a token separator.

See also
TrySexagesimalToDouble( double&, const Array<>& )

Definition at line 7297 of file String.h.

◆ SexagesimalToDouble() [2/4]

double pcl::String::SexagesimalToDouble ( const Array< char_type > &  separators) const
inline

Evaluates this string as a sexagesimal numeric literal representation with the specified set of separators, and returns the result as a double value.

This function is identical to SexagesimalToDouble( const String& ), but a set of separator characters is specified as a dynamic array. Any occurrence of a character contained by separators will be valid as a token separator.

See also
TrySexagesimalToDouble( double&, const Array<>& )

Definition at line 12005 of file String.h.

◆ SexagesimalToDouble() [3/4]

double pcl::IsoString::SexagesimalToDouble ( const IsoString separator = ':') const
inline

Evaluates this string as a sexagesimal numeric literal representation, and returns the result as a double value.

The source string is expected to have the following format:

[+|-]<s1>[<sep><s2>[<sep><s3>]][.[<decimal-part>]]

where <s1>, <s2>, <s3> and <decimal-part> are sequences of decimal digits from 0 to 9, and <sep> is any sequence of characters specified as the separator argument. The default separator is the colon character, ':'.

The result is equal to:

<sign> * (<s1> + <s2>/60 + <s3>/3600)

where omitted optional components are taken as zero, and <sign> is -1 iff a minus sign '-' leads the representation, or +1 otherwise.

If this string doesn't contain a valid sexagesimal numeric literal, or if the range of double is exceeded, this member function throws a ParseError exception.

See also
TrySexagesimalToDouble(), ParseSexagesimal(), TryParseSexagesimal()

Definition at line 7267 of file String.h.

◆ SexagesimalToDouble() [4/4]

double pcl::String::SexagesimalToDouble ( const String separator = ':') const
inline

Evaluates this string as a sexagesimal numeric literal representation, and returns the result as a double value.

The source string is expected to have the following format:

[+|-]<s1>[<sep><s2>[<sep><s3>]][.[<decimal-part>]]

where <s1>, <s2>, <s3> and <decimal-part> are sequences of decimal digits from 0 to 9, and <sep> is any sequence of characters specified as the separator argument. The default separator is the colon character, ':'.

The result is equal to:

<sign> * (<s1> + <s2>/60 + <s3>/3600)

where omitted optional components are taken as zero, and <sign> is -1 iff a minus sign '-' leads the representation, or +1 otherwise.

If this string doesn't contain a valid sexagesimal numeric literal, or if the range of double is exceeded, this member function throws a ParseError exception.

See also
TrySexagesimalToDouble(), ParseSexagesimal(), TryParseSexagesimal()

Definition at line 11985 of file String.h.

◆ ToSexagesimal() [1/4]

static IsoString pcl::IsoString::ToSexagesimal ( double  d,
const SexagesimalConversionOptions options = SexagesimalConversionOptions() 
)
inlinestatic

Returns a sexagesimal ASCII representation of the specified decimal value d, generated with the specified conversion options.

Calling this member function is equivalent to:

ToSexagesimal( (d < 0) ? -1 : +1, Abs( d ), 0, 0, options );
T Abs(const Complex< T > &c) noexcept
Definition: Complex.h:429
static IsoString ToSexagesimal(int sign, double s1, double s2, double s3, const SexagesimalConversionOptions &options=SexagesimalConversionOptions())

Definition at line 7497 of file String.h.

References pcl::Abs().

◆ ToSexagesimal() [2/4]

static String pcl::String::ToSexagesimal ( double  d,
const SexagesimalConversionOptions options = SexagesimalConversionOptions() 
)
inlinestatic

Returns a sexagesimal ASCII representation of the specified decimal value d, generated with the specified conversion options.

Calling this member function is equivalent to:

ToSexagesimal( (d < 0) ? -1 : +1, Abs( d ), 0, 0, options );
static String ToSexagesimal(int sign, double s1, double s2, double s3, const SexagesimalConversionOptions &options=SexagesimalConversionOptions())

Definition at line 12175 of file String.h.

References pcl::Abs().

◆ ToSexagesimal() [3/4]

static IsoString pcl::IsoString::ToSexagesimal ( int  sign,
double  s1,
double  s2,
double  s3,
const SexagesimalConversionOptions options = SexagesimalConversionOptions() 
)
static

Returns a sexagesimal ASCII representation of the specified components sign, s1, s2 and s3, generated with the specified conversion options.

The generated representation will correspond to a negative value iff sign < 0, positive otherwise.

The generated representation is of the form:

[+|-]<s1>[<sep><s2>[<sep><s3>]][.[<decimal-part>]]

where the second and third sexagesimal components are canonicalized:

0 ≤ <s2> < 60 0 ≤ <s3> < 60

irrespective of the original s2 and s3 argument values.

See also
SexagesimalToDouble(), SexagesimalConversionOptions, AngleConversionOptions, LongitudeConversionOptions, RAConversionOptions, LatitudeConversionOptions, DecConversionOptions

◆ ToSexagesimal() [4/4]

static String pcl::String::ToSexagesimal ( int  sign,
double  s1,
double  s2,
double  s3,
const SexagesimalConversionOptions options = SexagesimalConversionOptions() 
)
static

Returns a sexagesimal ASCII representation of the specified components sign, s1, s2 and s3, generated with the specified conversion options.

The generated representation will correspond to a negative value iff sign < 0, positive otherwise.

The generated representation is of the form:

[+|-]<s1>[<sep><s2>[<sep><s3>]][.[<decimal-part>]]

where the second and third sexagesimal components are canonicalized:

0 ≤ <s2> < 60 0 ≤ <s3> < 60

irrespective of the original s2 and s3 argument values.

See also
SexagesimalToDouble(), SexagesimalConversionOptions, AngleConversionOptions, LongitudeConversionOptions, RAConversionOptions, LatitudeConversionOptions, DecConversionOptions

◆ TryParseSexagesimal() [1/4]

bool pcl::IsoString::TryParseSexagesimal ( int &  sign,
int &  s1,
int &  s2,
double &  s3,
const Array< char_type > &  separators 
) const
noexcept

Attempts to evaluate this string as a sexagesimal numeric literal representation, using the specified set of separators.

This function is identical to TryParseSexagesimal( int&, int&, int&, double&, const IsoString& ), but a set of separator characters is specified as a dynamic array. Any occurrence of a character contained by separators will be valid as a token separator.

See also
ParseSexagesimal( int&, int&, int&, double&, const Array<>& )

◆ TryParseSexagesimal() [2/4]

bool pcl::String::TryParseSexagesimal ( int &  sign,
int &  s1,
int &  s2,
double &  s3,
const Array< char_type > &  separators 
) const
noexcept

Attempts to evaluate this string as a sexagesimal numeric literal representation, using the specified set of separators.

This function is identical to TryParseSexagesimal( int&, int&, int&, double&, const String& ), but a set of separator characters is specified as a dynamic array. Any occurrence of a character contained by separators will be valid as a token separator.

See also
ParseSexagesimal( int&, int&, int&, double&, const Array<>& )

◆ TryParseSexagesimal() [3/4]

bool pcl::IsoString::TryParseSexagesimal ( int &  sign,
int &  s1,
int &  s2,
double &  s3,
const IsoString separator = ':' 
) const
noexcept

Attempts to evaluate this string as a sexagesimal numeric literal representation, using the specified separator. If successful, stores the resulting components in the specified sign, s1, s2 and s3 variables, and returns true. For more information on syntax and output values and ranges, see the documentation for ParseSexagesimal().

If this string cannot be evaluated as a sexagesimal literal, this function returns false and does not change any of the sign, s1, s2 and s3 variables. This function does not throw any exception.

See also
ParseSexagesimal(), SexagesimalToDouble(), TrySexagesimalToDouble()

◆ TryParseSexagesimal() [4/4]

bool pcl::String::TryParseSexagesimal ( int &  sign,
int &  s1,
int &  s2,
double &  s3,
const String separator = ':' 
) const
noexcept

Attempts to evaluate this string as a sexagesimal numeric literal representation, using the specified separator. If successful, stores the resulting components in the specified sign, s1, s2 and s3 variables, and returns true. For more information on syntax and output values and ranges, see the documentation for ParseSexagesimal().

If this string cannot be evaluated as a sexagesimal literal, this function returns false and does not change any of the sign, s1, s2 and s3 variables. This function does not throw any exception.

See also
ParseSexagesimal(), SexagesimalToDouble(), TrySexagesimalToDouble()

◆ TrySexagesimalToDouble() [1/4]

bool pcl::IsoString::TrySexagesimalToDouble ( double &  value,
const Array< char_type > &  separators 
) const
inlinenoexcept

Attempts to evaluate this string as a sexagesimal numeric literal with the specified set of separators.

This function is identical to TrySexagesimalToDouble( double&, const IsoString& ), but a set of separator characters is specified as a dynamic array. Any occurrence of a character contained by separators will be valid as a token separator.

See also
SexagesimalToDouble( const Array<>& )

Definition at line 7354 of file String.h.

◆ TrySexagesimalToDouble() [2/4]

bool pcl::String::TrySexagesimalToDouble ( double &  value,
const Array< char_type > &  separators 
) const
inlinenoexcept

Attempts to evaluate this string as a sexagesimal numeric literal with the specified set of separators.

This function is identical to TrySexagesimalToDouble( double&, const String& ), but a set of separator characters is specified as a dynamic array. Any occurrence of a character contained by separators will be valid as a token separator.

See also
SexagesimalToDouble( const Array<>& )

Definition at line 12052 of file String.h.

◆ TrySexagesimalToDouble() [3/4]

bool pcl::IsoString::TrySexagesimalToDouble ( double &  value,
const IsoString separator = ':' 
) const
inlinenoexcept

Attempts to evaluate this string as a sexagesimal numeric literal with the specified separator.

If this string can legally be evaluated as a sexagesimal literal and converted to a floating point number, this function stores the evaluation result in the specified value variable and returns true. For information about the legal syntax of a sexagesimal literal, see the documentation for SexagesimalToDouble().

If this string cannot be evaluated as a sexagesimal literal, this function returns false and does not change the value variable. This function does not throw any exception.

See also
SexagesimalToDouble(), ParseSexagesimal(), TryParseSexagesimal()

Definition at line 7321 of file String.h.

◆ TrySexagesimalToDouble() [4/4]

bool pcl::String::TrySexagesimalToDouble ( double &  value,
const String separator = ':' 
) const
inlinenoexcept

Attempts to evaluate this string as a sexagesimal numeric literal with the specified separator.

If this string can legally be evaluated as a sexagesimal literal and converted to a floating point number, this function stores the evaluation result in the specified value variable and returns true. For information about the legal syntax of a sexagesimal literal, see the documentation for SexagesimalToDouble().

If this string cannot be evaluated as a sexagesimal literal, this function returns false and does not change the value variable. This function does not throw any exception.

See also
SexagesimalToDouble(), ParseSexagesimal(), TryParseSexagesimal()

Definition at line 12029 of file String.h.