Classes | Enumerations | Functions
gnsstk::StringUtils Namespace Reference

Detailed Description

Stuff to make the C++ string class a little easier to use.

All functions here will throw gnsstk::StringUtils::StringException on an error. Any std::exception is converted to a gnsstk::StringUtils::StringException so that's the only exception a user of this class needs to catch.

For any function that modifies a string, make sure there is a non-const (std::string&) version and a const (const std::string&) version. The convention for writing the functions is the non-const version fully implements the function and the const version calls the non-const version.

Classes

class  HexDumpDataConfig
 Class for configuring the appearance of hexDumpData() output. More...
 

Enumerations

enum  FFAlign { FFAlign::Left, FFAlign::Right }
 Alignment of data for floatFormat() More...
 
enum  FFLead { FFLead::Zero, FFLead::Decimal, FFLead::NonZero }
 Leading character for floatFormat(), after any whitespace or sign. More...
 
enum  FFSign { FFSign::NegOnly, FFSign::NegSpace, FFSign::NegPos }
 How to handle sign in floatFormat() More...
 

Functions

AngleType asAngleType (const std::string &s) noexcept
 Convert a string name to an AngleType. More...
 
CarrierBand asCarrierBand (const std::string &s) noexcept
 Convert a string name to an CarrierBand. More...
 
CorrDupHandling asCorrDupHandling (const std::string &s) noexcept
 Convert a string name to an CorrDupHandling. More...
 
CorrectorType asCorrectorType (const std::string &s) noexcept
 Convert a string name to an CorrectorType. More...
 
template<class X >
asData (const std::string &s)
 
double asDouble (const std::string &s)
 
DumpDetail asDumpDetail (const std::string &s) noexcept
 Convert a string name to an DumpDetail. More...
 
float asFloat (const std::string &s)
 
GalDataValid asGalDataValid (const std::string &s) noexcept
 Convert a string name to an GalDataValid. More...
 
GalHealthStatus asGalHealthStatus (const std::string &s) noexcept
 Convert a string name to an GalHealthStatus. More...
 
IERSConvention asIERSConvention (const std::string &s)
 Convert a string representation of IERSConvention to an enum. More...
 
long asInt (const std::string &s)
 
IonexStoreStrategy asIonexStoreStrategy (const std::string &s)
 Convert a string name to an IonexStoreStrategy. More...
 
long double asLongDouble (const std::string &s)
 
NavMessageType asNavMessageType (const std::string &s) noexcept
 Convert a string name to an NavMessageType. More...
 
NavSearchOrder asNavSearchOrder (const std::string &s)
 Convert a string name to an NavSearchOrder. More...
 
NavType asNavType (const std::string &s) noexcept
 Convert a string name to an NavType. More...
 
NavValidityType asNavValidityType (const std::string &s) noexcept
 Convert a string name to an NavValidityType. More...
 
ObservationType asObservationType (const std::string &s) noexcept
 Convert a string name to an ObservationType. More...
 
ReferenceFrame asReferenceFrame (const std::string &s)
 Convert a string representation of ReferenceFrame to an enum. More...
 
RefFrameRlz asRefFrameRlz (const std::string &s) noexcept
 Convert a string name to an RefFrameRlz. More...
 
RefFrameSys asRefFrameSys (const std::string &s) noexcept
 Convert a string name to an RefFrameSys. More...
 
SatelliteSystem asSatelliteSystem (const std::string &s) noexcept
 Convert a string name to an SatelliteSystem. More...
 
std::string asString (AngleType e) noexcept
 Convert a AngleType to a whitespace-free string name. More...
 
std::string asString (CarrierBand e) noexcept
 Convert a CarrierBand to a whitespace-free string name. More...
 
std::string asString (const double x, const std::string::size_type precision=17)
 
std::string asString (const long double x, const std::string::size_type precision=21)
 
std::string asString (const NavID &p)
 
std::string asString (const ObsID &id)
 convert this object to a string representation More...
 
std::string asString (const RinexObsID &p)
 
std::string asString (const SatID &p)
 SatID as a string. More...
 
template<class X >
std::string asString (const X x)
 
std::string asString (CorrDupHandling e) noexcept
 Convert a CorrDupHandling to a whitespace-free string name. More...
 
std::string asString (CorrectorType e) noexcept
 Convert a CorrectorType to a whitespace-free string name. More...
 
std::string asString (DumpDetail e) noexcept
 Convert a DumpDetail to a whitespace-free string name. More...
 
std::string asString (GalDataValid e) noexcept
 Convert a GalDataValid to a whitespace-free string name. More...
 
std::string asString (GalHealthStatus e) noexcept
 Convert a GalHealthStatus to a whitespace-free string name. More...
 
std::string asString (GLOCOrbitType e)
 
std::string asString (GLOCRegime e)
 
std::string asString (GLOCSatType e)
 
std::string asString (GLOFNavPCode e)
 Convert GLOFNavPCode to a printable string for dump(). More...
 
std::string asString (GLOFNavSatType e)
 Convert SatType to a printable string for dump(). More...
 
std::string asString (GPSLNavL2Codes e)
 Convert GPSLNavL2Codes to a printable string for dump(). More...
 
std::string asString (IERSConvention e)
 Convert a IERSConvention enum to its string representation. More...
 
std::string asString (IonexStoreStrategy e)
 Convert a IonexStoreStrategy to a whitespace-free string name. More...
 
std::string asString (NavMessageType e) noexcept
 Convert a NavMessageType to a whitespace-free string name. More...
 
std::string asString (NavSearchOrder e)
 Convert a NavSearchOrder to a whitespace-free string name. More...
 
std::string asString (NavType e) noexcept
 Convert a NavType to a whitespace-free string name. More...
 
std::string asString (NavValidityType e) noexcept
 Convert a NavValidityType to a whitespace-free string name. More...
 
std::string asString (ObservationType e) noexcept
 Convert a ObservationType to a whitespace-free string name. More...
 
std::string asString (ReferenceFrame e)
 Convert a ReferenceFrame enum to its string representation. More...
 
std::string asString (RefFrameRlz e) noexcept
 Convert a RefFrameRlz to a whitespace-free string name. More...
 
std::string asString (RefFrameSys e) noexcept
 Convert a RefFrameSys to a whitespace-free string name. More...
 
std::string asString (SatelliteSystem e) noexcept
 Convert a SatelliteSystem to a whitespace-free string name. More...
 
std::string asString (SVHealth e) noexcept
 Convert a SVHealth to a whitespace-free string name. More...
 
std::string asString (TimeOffsetFilter e) noexcept
 Convert a TimeOffsetFilter to a whitespace-free string name. More...
 
std::string asString (TimeSystem ts)
 Convert a TimeSystem enum to its string representation. More...
 
std::string asString (TrackingCode e) noexcept
 Convert a TrackingCode to a whitespace-free string name. More...
 
std::string asString (XmitAnt e) noexcept
 Convert a XmitAnt to a whitespace-free string name. More...
 
SVHealth asSVHealth (const std::string &s) noexcept
 Convert a string name to an SVHealth. More...
 
TimeOffsetFilter asTimeOffsetFilter (const std::string &s) noexcept
 Convert a string name to a TimeOffsetFilter. More...
 
TimeSystem asTimeSystem (const std::string &s)
 Convert a string representation of TimeSystem to an enum. More...
 
TrackingCode asTrackingCode (const std::string &s) noexcept
 Convert a string name to an TrackingCode. More...
 
unsigned long asUnsigned (const std::string &s)
 
XmitAnt asXmitAnt (const std::string &s) noexcept
 Convert a string name to an XmitAnt. More...
 
std::string c2x (const std::string &s)
 
std::string & c2x (std::string &s)
 
std::string center (const std::string &s, const std::string::size_type length, const char pad=' ')
 
std::string & center (std::string &s, const std::string::size_type length, const char pad=' ')
 
std::string change (const std::string &aString, const std::string &inputString, const std::string &outputString, std::string::size_type startPos=0, unsigned numChanges=(std::numeric_limits< unsigned >().max()))
 
std::string & change (std::string &aString, const std::string &inputString, const std::string &outputString, std::string::size_type startPos=0, unsigned numChanges=(std::numeric_limits< unsigned >::max)())
 
std::string d2x (const std::string &s)
 
std::string & d2x (std::string &s)
 
std::string doub2for (const double &d, const std::string::size_type length, const std::string::size_type expLen, const bool checkSwitch=true)
 
std::string doub2sci (const double &d, const std::string::size_type length, const std::string::size_type expLen, const bool showSign=true, const bool checkSwitch=true)
 
std::string doubleToScientific (const double &d, const std::string::size_type length, const std::string::size_type precision, const std::string::size_type explen, bool showPlus=false)
 
std::string firstWord (const std::string &s, const char delimiter=' ')
 
std::string floatFormat (double d, FFLead lead, unsigned mantissa, unsigned exponent, unsigned width, char expChar, FFSign sign, FFAlign align)
 
double for2doub (const std::string &aStr, const std::string::size_type startPos=0, const std::string::size_type length=std::string::npos)
 
template<class T >
std::string formattedPrint (const std::string &fmt, const std::string &pat, const std::string &rep, T to)
 
void hexDumpData (const std::string &data, std::ostream &s, const HexDumpDataConfig &cfg)
 
void hexDumpData (std::ostream &s, const std::string &data, const std::string &tag, HexDumpDataConfig cfg=HexDumpDataConfig())
 
void hexDumpData (std::ostream &s, const std::string &data, unsigned indent=0, const HexDumpDataConfig &cfg=HexDumpDataConfig())
 
std::string int2x (const unsigned int &i)
 
bool isAlphaString (const std::string &s)
 
bool isDecimalString (const std::string &s)
 
bool isDigitString (const std::string &s)
 
bool isLike (const std::string &s, const char *pPattern, const char zeroOrMore=' *', const char oneOrMore='+', const char anyChar='.')
 
bool isLike (const std::string &s, const std::string &aPattern, const char zeroOrMore=' *', const char oneOrMore='+', const char anyChar='.')
 
bool isScientificString (const std::string &s)
 
std::string leftJustify (const std::string &s, const std::string::size_type length, const char pad=' ')
 
std::string & leftJustify (std::string &s, const std::string::size_type length, const char pad=' ')
 
std::string lowerCase (const std::string &s)
 
std::string & lowerCase (std::string &s)
 
std::string matches (const std::string &s, const std::string &aPattern, const char zeroOrMore=' *', const char oneOrMore='+', const char anyChar='.')
 
std::string memToString (const void *p, const std::string::size_type size)
 
 NEW_EXCEPTION_CLASS (StringException, Exception)
 
int numWords (const std::string &s, const char delimiter=' ')
 
std::string prettyPrint (const std::string &aStr, const std::string &lineDelim="\n", const std::string &indent="", const std::string &firstIndent=" ", const std::string::size_type len=80, const char wordDelim=' ')
 
std::string & prettyPrint (std::string &aStr, const std::string &lineDelim="\n", const std::string &indent="", const std::string &firstIndent=" ", const std::string::size_type len=80, const char wordDelim=' ')
 
std::string printable (const std::string &aStr)
 
std::string & removeWords (std::string &s, const std::string::size_type first=0, const std::string::size_type wordsToReplace=std::string::npos, const char delimiter=' ')
 
std::string & replaceAll (std::string &s, const std::string &oldString, const std::string &newString)
 
std::string rightJustify (const std::string &s, const std::string::size_type length, const char pad=' ')
 
std::string & rightJustify (std::string &s, const std::string::size_type length, const char pad=' ')
 
std::string & sci2for (std::string &aStr, const std::string::size_type startPos=0, const std::string::size_type length=std::string::npos, const std::string::size_type expLen=3, const bool checkSwitch=true)
 
std::vector< std::string > split (const std::string &aStr, const std::string &theDelimiters, bool trimWhitespace=false, bool ignoreEmpty=true)
 
std::vector< std::string > split (const std::string &str, const char delimiter=' ')
 
std::vector< std::string > splitWithDoubleQuotes (const std::string &aStr, const char delimiter=' ', bool trimWhitespace=true, bool ignoreEmpty=true)
 
std::vector< std::string > splitWithQuotes (const std::string &aStr, const char delimiter=' ', bool trimWhitespace=true, bool ignoreEmpty=true)
 
std::string strip (const std::string &s, const char *pString, std::string::size_type num=std::string::npos)
 
std::string strip (const std::string &s, const char aCharacter, std::string::size_type num=std::string::npos)
 
std::string strip (const std::string &s, const std::string &aString, std::string::size_type num=std::string::npos)
 
std::string strip (const std::string &s, std::string::size_type num=std::string::npos)
 
std::string & strip (std::string &s, const char *pString, std::string::size_type num=std::string::npos)
 
std::string & strip (std::string &s, const char aCharacter, std::string::size_type num=std::string::npos)
 
std::string & strip (std::string &s, const std::string &aString, std::string::size_type num=std::string::npos)
 
std::string & strip (std::string &s, std::string::size_type num=std::string::npos)
 
std::string stripFirstWord (std::string &s, const char delimiter=' ')
 
std::string stripLeading (const std::string &s, const char *pString, std::string::size_type num=std::string::npos)
 
std::string stripLeading (const std::string &s, const char aCharacter, std::string::size_type num=std::string::npos)
 
std::string stripLeading (const std::string &s, const std::string &aString, std::string::size_type num=std::string::npos)
 
std::string stripLeading (const std::string &s, std::string::size_type num=std::string::npos)
 
std::string & stripLeading (std::string &s, const char *pString, std::string::size_type num=std::string::npos)
 
std::string & stripLeading (std::string &s, const char aCharacter, std::string::size_type num=std::string::npos)
 
std::string & stripLeading (std::string &s, const std::string &aString, std::string::size_type num=std::string::npos)
 
std::string & stripLeading (std::string &s, std::string::size_type num=std::string::npos)
 
std::string stripTrailing (const std::string &s, const char *pString, std::string::size_type num=std::string::npos)
 
std::string stripTrailing (const std::string &s, const char aCharacter, std::string::size_type num=std::string::npos)
 
std::string stripTrailing (const std::string &s, const std::string &aString, std::string::size_type num=std::string::npos)
 
std::string stripTrailing (const std::string &s, std::string::size_type num=std::string::npos)
 
std::string & stripTrailing (std::string &s, const char *pString, std::string::size_type num=std::string::npos)
 
std::string & stripTrailing (std::string &s, const char aCharacter, std::string::size_type num=std::string::npos)
 
std::string & stripTrailing (std::string &s, const std::string &aString, std::string::size_type num=std::string::npos)
 
std::string & stripTrailing (std::string &s, std::string::size_type num=std::string::npos)
 
std::string subString (const std::string &s, const std::string::size_type startPos=0, const std::string::size_type length=std::string::npos, const char pad=' ')
 
std::string tabularize (const std::vector< std::string > &cells, std::string::size_type width=80, bool force=false)
 
std::string translate (const std::string &aString, const std::string &inputChars, const std::string &outputChars, const char pad=' ')
 
std::string upperCase (const std::string &s)
 
std::string & upperCase (std::string &s)
 
std::string word (const std::string &s, const std::string::size_type wordNum=0, const char delimiter=' ')
 
std::string words (const std::string &s, const std::string::size_type firstWord=0, const std::string::size_type numWords=std::string::npos, const char delimiter=' ')
 
std::string x2d (const std::string &s)
 
std::string & x2d (std::string &s)
 
unsigned int x2uint (const std::string &s)
 

Enumeration Type Documentation

◆ FFAlign

Alignment of data for floatFormat()

Enumerator
Left 

Formatted output will be left-aligned.

Right 

Formatted output will be right-aligned.

Definition at line 125 of file StringUtils.hpp.

◆ FFLead

Leading character for floatFormat(), after any whitespace or sign.

Enumerator
Zero 

Start with zero, e.g. 0.12345.

Decimal 

Start with decimal, e.g. .12345.

NonZero 

Start with the first non-zero digit, e.g. 1.2345.

Definition at line 109 of file StringUtils.hpp.

◆ FFSign

How to handle sign in floatFormat()

Enumerator
NegOnly 

Prefix output with a minus sign (neg) or nothing (pos)

NegSpace 

Prefix output with a minus sign (neg) or space (pos)

NegPos 

Prefix output with a minus sign (neg) or plus sign (pos)

Definition at line 117 of file StringUtils.hpp.

Function Documentation

◆ asAngleType()

AngleType gnsstk::StringUtils::asAngleType ( const std::string &  s)
noexcept

Convert a string name to an AngleType.

Definition at line 61 of file AngleType.cpp.

◆ asCarrierBand()

CarrierBand gnsstk::StringUtils::asCarrierBand ( const std::string &  s)
noexcept

Convert a string name to an CarrierBand.

Definition at line 80 of file CarrierBand.cpp.

◆ asCorrDupHandling()

CorrDupHandling gnsstk::StringUtils::asCorrDupHandling ( const std::string &  s)
noexcept

Convert a string name to an CorrDupHandling.

Definition at line 58 of file CorrDupHandling.cpp.

◆ asCorrectorType()

CorrectorType gnsstk::StringUtils::asCorrectorType ( const std::string &  s)
noexcept

Convert a string name to an CorrectorType.

Definition at line 60 of file CorrectorType.cpp.

◆ asData()

template<class X >
X gnsstk::StringUtils::asData ( const std::string &  s)
inline

Convert a value in a string to a type specified by the template class. The template class type must have stream operators defined.

Parameters
sobject to turn into the templatized type.
Returns
the template object of x.
Exceptions
StringException

Definition at line 1669 of file StringUtils.hpp.

◆ asDouble()

double gnsstk::StringUtils::asDouble ( const std::string &  s)
inline

Convert a string to a double precision floating point number.

Parameters
sstring containing a number.
Returns
double representation of string.

Definition at line 705 of file StringUtils.hpp.

◆ asDumpDetail()

DumpDetail gnsstk::StringUtils::asDumpDetail ( const std::string &  s)
noexcept

Convert a string name to an DumpDetail.

Definition at line 59 of file DumpDetail.cpp.

◆ asFloat()

float gnsstk::StringUtils::asFloat ( const std::string &  s)
inline

Convert a string to a single precision floating point number.

Parameters
sstring containing a number.
Returns
single representation of string.
Exceptions
StringException

Definition at line 1636 of file StringUtils.hpp.

◆ asGalDataValid()

GalDataValid gnsstk::StringUtils::asGalDataValid ( const std::string &  s)
noexcept

Convert a string name to an GalDataValid.

Definition at line 57 of file GalDataValid.cpp.

◆ asGalHealthStatus()

GalHealthStatus gnsstk::StringUtils::asGalHealthStatus ( const std::string &  s)
noexcept

Convert a string name to an GalHealthStatus.

Definition at line 59 of file GalHealthStatus.cpp.

◆ asIERSConvention()

IERSConvention gnsstk::StringUtils::asIERSConvention ( const std::string &  s)

Convert a string representation of IERSConvention to an enum.

Definition at line 67 of file IERSConvention.cpp.

◆ asInt()

long gnsstk::StringUtils::asInt ( const std::string &  s)
inline

Convert a string to an integer.

Parameters
sstring containing a number.
Returns
long integer representation of string.

Definition at line 713 of file StringUtils.hpp.

◆ asIonexStoreStrategy()

IonexStoreStrategy gnsstk::StringUtils::asIonexStoreStrategy ( const std::string &  s)

Convert a string name to an IonexStoreStrategy.

Definition at line 60 of file IonexStoreStrategy.cpp.

◆ asLongDouble()

long double gnsstk::StringUtils::asLongDouble ( const std::string &  s)
inline

Convert a string to a big precision floating point number.

Parameters
sstring containing a number.
Returns
long double representation of string.
Exceptions
StringException

Definition at line 1652 of file StringUtils.hpp.

◆ asNavMessageType()

NavMessageType gnsstk::StringUtils::asNavMessageType ( const std::string &  s)
noexcept

Convert a string name to an NavMessageType.

Definition at line 62 of file NavMessageType.cpp.

◆ asNavSearchOrder()

NavSearchOrder gnsstk::StringUtils::asNavSearchOrder ( const std::string &  s)

Convert a string name to an NavSearchOrder.

Definition at line 58 of file NavSearchOrder.cpp.

◆ asNavType()

NavType gnsstk::StringUtils::asNavType ( const std::string &  s)
noexcept

Convert a string name to an NavType.

Definition at line 75 of file NavType.cpp.

◆ asNavValidityType()

NavValidityType gnsstk::StringUtils::asNavValidityType ( const std::string &  s)
noexcept

Convert a string name to an NavValidityType.

Definition at line 58 of file NavValidityType.cpp.

◆ asObservationType()

ObservationType gnsstk::StringUtils::asObservationType ( const std::string &  s)
noexcept

Convert a string name to an ObservationType.

Definition at line 78 of file ObservationType.cpp.

◆ asReferenceFrame()

ReferenceFrame gnsstk::StringUtils::asReferenceFrame ( const std::string &  s)

Convert a string representation of ReferenceFrame to an enum.

Definition at line 74 of file ReferenceFrame.cpp.

◆ asRefFrameRlz()

RefFrameRlz gnsstk::StringUtils::asRefFrameRlz ( const std::string &  s)
noexcept

Convert a string name to an RefFrameRlz.

Definition at line 210 of file RefFrameRlz.cpp.

◆ asRefFrameSys()

RefFrameSys gnsstk::StringUtils::asRefFrameSys ( const std::string &  s)
noexcept

Convert a string name to an RefFrameSys.

Definition at line 62 of file RefFrameSys.cpp.

◆ asSatelliteSystem()

SatelliteSystem gnsstk::StringUtils::asSatelliteSystem ( const std::string &  s)
noexcept

Convert a string name to an SatelliteSystem.

Definition at line 73 of file SatelliteSystem.cpp.

◆ asString() [1/36]

std::string gnsstk::StringUtils::asString ( AngleType  e)
noexcept

Convert a AngleType to a whitespace-free string name.

Definition at line 46 of file AngleType.cpp.

◆ asString() [2/36]

std::string gnsstk::StringUtils::asString ( CarrierBand  e)
noexcept

Convert a CarrierBand to a whitespace-free string name.

Definition at line 52 of file CarrierBand.cpp.

◆ asString() [3/36]

std::string gnsstk::StringUtils::asString ( const double  x,
const std::string::size_type  precision = 17 
)
inline

Convert a double to a string in fixed notation.

Parameters
xdouble.
precisionthe number of decimal places you want displayed.
Returns
string representation of x.

Definition at line 1692 of file StringUtils.hpp.

◆ asString() [4/36]

std::string gnsstk::StringUtils::asString ( const long double  x,
const std::string::size_type  precision = 21 
)
inline

Convert a long double to a string in fixed notation.

Parameters
xlong double.
precisionthe number of decimal places you want displayed.
Returns
string representation of x.

Definition at line 1685 of file StringUtils.hpp.

◆ asString() [5/36]

std::string gnsstk::StringUtils::asString ( const NavID p)
inline

Definition at line 127 of file NavID.hpp.

◆ asString() [6/36]

std::string gnsstk::StringUtils::asString ( const ObsID p)

convert this object to a string representation

Definition at line 173 of file ObsID.cpp.

◆ asString() [7/36]

std::string gnsstk::StringUtils::asString ( const RinexObsID p)

Definition at line 183 of file RinexObsID.cpp.

◆ asString() [8/36]

std::string gnsstk::StringUtils::asString ( const SatID p)
inline

SatID as a string.

Definition at line 175 of file SatID.hpp.

◆ asString() [9/36]

template<class X >
std::string gnsstk::StringUtils::asString ( const x)
inline

Convert any old object to a string. The class must have stream operators defined.

Parameters
xobject to turn into a string.
Returns
string representation of x.

Definition at line 1700 of file StringUtils.hpp.

◆ asString() [10/36]

std::string gnsstk::StringUtils::asString ( CorrDupHandling  e)
noexcept

Convert a CorrDupHandling to a whitespace-free string name.

Definition at line 45 of file CorrDupHandling.cpp.

◆ asString() [11/36]

std::string gnsstk::StringUtils::asString ( CorrectorType  e)
noexcept

Convert a CorrectorType to a whitespace-free string name.

Definition at line 45 of file CorrectorType.cpp.

◆ asString() [12/36]

std::string gnsstk::StringUtils::asString ( DumpDetail  e)
noexcept

Convert a DumpDetail to a whitespace-free string name.

Definition at line 45 of file DumpDetail.cpp.

◆ asString() [13/36]

std::string gnsstk::StringUtils::asString ( GalDataValid  e)
noexcept

Convert a GalDataValid to a whitespace-free string name.

Definition at line 45 of file GalDataValid.cpp.

◆ asString() [14/36]

std::string gnsstk::StringUtils::asString ( GalHealthStatus  e)
noexcept

Convert a GalHealthStatus to a whitespace-free string name.

Definition at line 45 of file GalHealthStatus.cpp.

◆ asString() [15/36]

std::string gnsstk::StringUtils::asString ( GLOCOrbitType  e)

Definition at line 46 of file GLOCOrbitType.cpp.

◆ asString() [16/36]

std::string gnsstk::StringUtils::asString ( GLOCRegime  e)

Definition at line 46 of file GLOCRegime.cpp.

◆ asString() [17/36]

std::string gnsstk::StringUtils::asString ( GLOCSatType  e)

Definition at line 46 of file GLOCSatType.cpp.

◆ asString() [18/36]

std::string gnsstk::StringUtils::asString ( GLOFNavPCode  e)

Convert GLOFNavPCode to a printable string for dump().

Definition at line 47 of file GLOFNavPCode.cpp.

◆ asString() [19/36]

std::string gnsstk::StringUtils::asString ( GLOFNavSatType  e)

Convert SatType to a printable string for dump().

Definition at line 47 of file GLOFNavSatType.cpp.

◆ asString() [20/36]

std::string gnsstk::StringUtils::asString ( GPSLNavL2Codes  e)

Convert GPSLNavL2Codes to a printable string for dump().

Definition at line 47 of file GPSLNavL2Codes.cpp.

◆ asString() [21/36]

std::string gnsstk::StringUtils::asString ( IERSConvention  e)

Convert a IERSConvention enum to its string representation.

Definition at line 50 of file IERSConvention.cpp.

◆ asString() [22/36]

std::string gnsstk::StringUtils::asString ( IonexStoreStrategy  e)

Convert a IonexStoreStrategy to a whitespace-free string name.

Definition at line 46 of file IonexStoreStrategy.cpp.

◆ asString() [23/36]

std::string gnsstk::StringUtils::asString ( NavMessageType  e)
noexcept

Convert a NavMessageType to a whitespace-free string name.

Definition at line 45 of file NavMessageType.cpp.

◆ asString() [24/36]

std::string gnsstk::StringUtils::asString ( NavSearchOrder  e)

Convert a NavSearchOrder to a whitespace-free string name.

Definition at line 46 of file NavSearchOrder.cpp.

◆ asString() [25/36]

std::string gnsstk::StringUtils::asString ( NavType  e)
noexcept

Convert a NavType to a whitespace-free string name.

Definition at line 52 of file NavType.cpp.

◆ asString() [26/36]

std::string gnsstk::StringUtils::asString ( NavValidityType  e)
noexcept

Convert a NavValidityType to a whitespace-free string name.

Definition at line 45 of file NavValidityType.cpp.

◆ asString() [27/36]

std::string gnsstk::StringUtils::asString ( ObservationType  e)
noexcept

Convert a ObservationType to a whitespace-free string name.

Definition at line 52 of file ObservationType.cpp.

◆ asString() [28/36]

std::string gnsstk::StringUtils::asString ( ReferenceFrame  e)

Convert a ReferenceFrame enum to its string representation.

Definition at line 47 of file ReferenceFrame.cpp.

◆ asString() [29/36]

std::string gnsstk::StringUtils::asString ( RefFrameRlz  e)
noexcept

Convert a RefFrameRlz to a whitespace-free string name.

Definition at line 181 of file RefFrameRlz.cpp.

◆ asString() [30/36]

std::string gnsstk::StringUtils::asString ( RefFrameSys  e)
noexcept

Convert a RefFrameSys to a whitespace-free string name.

Definition at line 47 of file RefFrameSys.cpp.

◆ asString() [31/36]

std::string gnsstk::StringUtils::asString ( SatelliteSystem  e)
noexcept

Convert a SatelliteSystem to a whitespace-free string name.

Definition at line 52 of file SatelliteSystem.cpp.

◆ asString() [32/36]

std::string gnsstk::StringUtils::asString ( SVHealth  e)
noexcept

Convert a SVHealth to a whitespace-free string name.

Definition at line 70 of file SVHealth.cpp.

◆ asString() [33/36]

std::string gnsstk::StringUtils::asString ( TimeOffsetFilter  e)
noexcept

Convert a TimeOffsetFilter to a whitespace-free string name.

Definition at line 46 of file TimeOffsetFilter.cpp.

◆ asString() [34/36]

std::string gnsstk::StringUtils::asString ( TimeSystem  ts)

Convert a TimeSystem enum to its string representation.

Definition at line 303 of file TimeSystem.cpp.

◆ asString() [35/36]

std::string gnsstk::StringUtils::asString ( TrackingCode  e)
noexcept

Convert a TrackingCode to a whitespace-free string name.

Definition at line 52 of file TrackingCode.cpp.

◆ asString() [36/36]

std::string gnsstk::StringUtils::asString ( XmitAnt  e)
noexcept

Convert a XmitAnt to a whitespace-free string name.

Definition at line 45 of file XmitAnt.cpp.

◆ asSVHealth()

SVHealth gnsstk::StringUtils::asSVHealth ( const std::string &  s)
noexcept

Convert a string name to an SVHealth.

Definition at line 84 of file SVHealth.cpp.

◆ asTimeOffsetFilter()

TimeOffsetFilter gnsstk::StringUtils::asTimeOffsetFilter ( const std::string &  s)
noexcept

Convert a string name to a TimeOffsetFilter.

Definition at line 59 of file TimeOffsetFilter.cpp.

◆ asTimeSystem()

TimeSystem gnsstk::StringUtils::asTimeSystem ( const std::string &  s)

Convert a string representation of TimeSystem to an enum.

Definition at line 324 of file TimeSystem.cpp.

◆ asTrackingCode()

TrackingCode gnsstk::StringUtils::asTrackingCode ( const std::string &  s)
noexcept

Convert a string name to an TrackingCode.

Definition at line 182 of file TrackingCode.cpp.

◆ asUnsigned()

unsigned long gnsstk::StringUtils::asUnsigned ( const std::string &  s)
inline

Convert a string to an unsigned integer.

Parameters
sstring containing a number.
Returns
unsigned long integer representation of string.

Definition at line 721 of file StringUtils.hpp.

◆ asXmitAnt()

XmitAnt gnsstk::StringUtils::asXmitAnt ( const std::string &  s)
noexcept

Convert a string name to an XmitAnt.

Definition at line 58 of file XmitAnt.cpp.

◆ c2x() [1/2]

std::string gnsstk::StringUtils::c2x ( const std::string &  s)
inline

Convert a character string to a hexadecimal string.

Parameters
sstring containing an integer.
Returns
string containing a sequence of hexadecimal numbers.
Exceptions
StringException

Definition at line 842 of file StringUtils.hpp.

◆ c2x() [2/2]

std::string & gnsstk::StringUtils::c2x ( std::string &  s)
inline

Convert a character string to a hexadecimal string. Modify the string such that the character string is now represented as series of hexadecimal digits.

Parameters
sstring to convert.
Returns
reference to modified s.
Exceptions
StringException

Definition at line 1740 of file StringUtils.hpp.

◆ center() [1/2]

std::string gnsstk::StringUtils::center ( const std::string &  s,
const std::string::size_type  length,
const char  pad = ' ' 
)
inline

Change the length of a string by adding to the beginning and end (const version). The string s is modified to the specified length. If the string is shorter than length, then the string is truncated with the left-most length characters remaining. Otherwise, characters are added to the beginning and end of the string until the string is the specified length, where the number of characters added to the beginning and the end does not differ by more than one so the original string is centered.

Parameters
sstring to be modified.
lengthnew desired length of string.
padcharacter to pad string with (blank by default).
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 695 of file StringUtils.hpp.

◆ center() [2/2]

std::string & gnsstk::StringUtils::center ( std::string &  s,
const std::string::size_type  length,
const char  pad = ' ' 
)
inline

Change the length of a string by adding to the beginning and end. The string s is modified to the specified length. If the string is shorter than length, then the string is truncated with the left-most length characters remaining. Otherwise, characters are added to the beginning and end of the string until the string is the specified length, where the number of characters added to the beginning and the end does not differ by more than one so the original string is centered.

Parameters
sstring to be modified.
lengthnew desired length of string.
padcharacter to pad string with (blank by default).
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 1607 of file StringUtils.hpp.

◆ change() [1/2]

std::string gnsstk::StringUtils::change ( const std::string &  aString,
const std::string &  inputString,
const std::string &  outputString,
std::string::size_type  startPos = 0,
unsigned  numChanges = (std::numeric_limits<unsigned>().max()) 
)
inline

Changes occurrences of a specified pattern to a specified replacement string. You can specify the number of changes to perform. The default is to change all occurrences of the pattern. You can also specify the position in the receiver at which to begin.

Parameters
aStringstring to perform translation on.
inputStringThe pattern string as a reference to an object of type string. The library searches for the pattern string within the receiver's data.
outputStringThe replacement string as a reference to an object of type string. It replaces the occurrences of the pattern string in the receiver's data.
startPosThe position to start the search at within the receiver's data. The default is 0.
numChangesthe number of patterns to search for and change. The default is to change all occurrences of the pattern.

Definition at line 1521 of file StringUtils.hpp.

◆ change() [2/2]

std::string & gnsstk::StringUtils::change ( std::string &  aString,
const std::string &  inputString,
const std::string &  outputString,
std::string::size_type  startPos = 0,
unsigned  numChanges = (std::numeric_limits<unsigned>::max)() 
)
inline

Changes occurrences of a specified pattern to a specified replacement string. You can specify the number of changes to perform. The default is to change all occurrences of the pattern. You can also specify the position in the receiver at which to begin.

Parameters
aStringstring to perform translation on.
inputStringThe pattern string as a reference to an object of type string. The library searches for the pattern string within the receiver's data.
outputStringThe replacement string as a reference to an object of type string. It replaces the occurrences of the pattern string in the receiver's data.
startPosThe position to start the search at within the receiver's data. The default is 0.
numChangesthe number of patterns to search for and change. The default is to change all occurrences of the pattern.

Definition at line 1531 of file StringUtils.hpp.

◆ d2x() [1/2]

std::string gnsstk::StringUtils::d2x ( const std::string &  s)
inline

Convert a decimal string to a hexadecimal string. Given a string containing a decimal integer, convert the integer from base 10 to base 16 and return the result. No prefix is added. Only the first decimal encountered is changed; the rest of the string is unmodified.

Parameters
sstring containing an integer.
Returns
string containing a hexadecimal number.
Exceptions
StringException

Definition at line 799 of file StringUtils.hpp.

◆ d2x() [2/2]

std::string & gnsstk::StringUtils::d2x ( std::string &  s)
inline

Convert a decimal string to a hexadecimal string. Modify the string such that the decimal integer is now represented as hexadecimal. Only the first decimal encountered is changed; the rest of the string is unmodified.

Parameters
sstring containing an integer.
Returns
reference to modified s.
Exceptions
StringException

Definition at line 1708 of file StringUtils.hpp.

◆ doub2for()

std::string gnsstk::StringUtils::doub2for ( const double &  d,
const std::string::size_type  length,
const std::string::size_type  expLen,
const bool  checkSwitch = true 
)
inline

Convert double precision floating point to a string containing the number in FORTRAN notation. As an example, the number 156360 becomes ".15636D6".

Parameters
dnumber to convert.
lengthlength (in characters) of number, including exponent.
expLenlength (in characters of exponent, including sign.
checkSwitchif true, keeps the exponential sanity check for exponentials above three characters in length. If false, it removes that check.
Returns
a string containing d in FORTRAN notation.
Exceptions
StringException
Bug:
The rendered width is not correct if checkSwitch=false
Deprecated:
This method is being replaced by FormattedDouble and is scheduled for removal in the first tagged release of Q4 2020.

Definition at line 2668 of file StringUtils.hpp.

◆ doub2sci()

std::string gnsstk::StringUtils::doub2sci ( const double &  d,
const std::string::size_type  length,
const std::string::size_type  expLen,
const bool  showSign = true,
const bool  checkSwitch = true 
)
inline

Convert a double to a scientific notation number.

Parameters
dthe double to convert
lengthlength (in characters) of output, including exponent
expLenlength (in characters) of the exponent, with sign
showSignif true, reserves 1 character for +/- sign
checkSwitchif true, keeps the exponential sanity check for exponentials above three characters in length. If false, it removes that check.
Deprecated:
This method is being replaced by FormattedDouble and is scheduled for removal in the first tagged release of Q4 2020.

Definition at line 2491 of file StringUtils.hpp.

◆ doubleToScientific()

std::string gnsstk::StringUtils::doubleToScientific ( const double &  d,
const std::string::size_type  length,
const std::string::size_type  precision,
const std::string::size_type  explen,
bool  showPlus = false 
)
inline

Convert a double to scientific notation; this routine works better, on Windows particularly, than doub2sci.

Parameters
length= total string length, including 1 for overall sign if showPlus is true.
precision= number of digits after the decimal and before the 'e'
explen= length of exponent, this must = 1, 2 or 3 NB. length is increased if precision, explen and showPlus require it.
Deprecated:
This method is being replaced by FormattedDouble and is scheduled for removal in the first tagged release of Q4 2020.

Definition at line 2525 of file StringUtils.hpp.

◆ firstWord()

std::string gnsstk::StringUtils::firstWord ( const std::string &  s,
const char  delimiter = ' ' 
)
inline

Returns the first word in string s without modifying the string.

Parameters
sthe string to count the words from.
delimiterthe character that marks the start and end of a word.
Returns
the first word from s;
Exceptions
StringException

Definition at line 2138 of file StringUtils.hpp.

◆ floatFormat()

std::string gnsstk::StringUtils::floatFormat ( double  d,
FFLead  lead,
unsigned  mantissa,
unsigned  exponent,
unsigned  width = 0,
char  expChar = 'e',
FFSign  sign = FFSign::NegOnly,
FFAlign  align = FFAlign::Left 
)

Format a floating point value according to rules not directly supported by C++ stream I/O.

See also
FormattedDouble which should generally be used rather than using this function directly.
Parameters
[in]dThe value that is to be formatted in an ostream.
[in]leadHow the lead-in to the value is to be formatted.
[in]mantissaHow many digits of precision should be in the mantissa, e.g. mantissa=5 could result in something like 1.2345e+00.
[in]exponentHow many digits of precision should be in the exponent, e.g. exponent=3 could result in something like 1.2345e+000. Exponents will always be at least 2 characters in length.
[in]widthThe total number of characters in the formatted value. If the length of the formatted value including mantissa, exponent, sign, etc. is >= width, no additional formatting will take place. If the length of the formatted value is < width, it will be padded with spaces according to align.
[in]expCharThe character used to designate the exponent, e.g. "e" or "E" or "D".
[in]signHow numerical sign is to be handled in formatting.
[in]alignHow to pad the formatted value according to width. Left adds space to the end of the formatted value while Right inserts space at the beginning.

Definition at line 210 of file StringUtils.cpp.

◆ for2doub()

double gnsstk::StringUtils::for2doub ( const std::string &  aStr,
const std::string::size_type  startPos = 0,
const std::string::size_type  length = std::string::npos 
)
inline

Convert FORTRAN representation of a double precision floating point in a string to a number. As an example, the number ".15636D6" becomes 156360.

Parameters
aStrstring containing FORTRAN representation of number.
startPosbeginning of number in string.
lengthlength (in characters) of number, including exponent.
Returns
value of the number.
Deprecated:
This method is being replaced by FormattedDouble and is scheduled for removal in the first tagged release of Q4 2020.

Definition at line 2698 of file StringUtils.hpp.

◆ formattedPrint()

template<class T >
std::string gnsstk::StringUtils::formattedPrint ( const std::string &  fmt,
const std::string &  pat,
const std::string &  rep,
to 
)
inline

Work-horse method for printf. Substitutes patterns matching pat with rep. Use only one pattern/token at a time! This used to be DayTime::iprint().

Parameters
fmtformat to use for this time.
patregular expression pattern to match.
repsprintf token replacement. First character is token character used in fmt, remainder is sprintf token to use. For example, with fmt="%15S", pat="%[ 0-]?[[:digit:]]*S", and rep="Sd", the fmt will be translated to "%15d" before using it in a sprintf call like printf("%15d"), to.
tothe value to stuff into the string.
Returns
fmt with pat replaced by to. If there is no match, fmt is returned unchanged.
Exceptions
StringException

Definition at line 2020 of file StringUtils.hpp.

◆ hexDumpData() [1/3]

void gnsstk::StringUtils::hexDumpData ( const std::string &  data,
std::ostream &  s,
const HexDumpDataConfig cfg = HexDumpDataConfig() 
)

Perform a formatted hex-dump of the (potentially) binary data to the given stream.

Note
argument order reversed from earlier implementations to avoid ambiguity of prototypes.
Parameters
[in]datadata to hex-dump.
[in,out]sstream to dump data to.
[in]cfgformatting configuration.

Definition at line 62 of file StringUtils.cpp.

◆ hexDumpData() [2/3]

void gnsstk::StringUtils::hexDumpData ( std::ostream &  s,
const std::string &  data,
const std::string &  tag,
HexDumpDataConfig  cfg = HexDumpDataConfig() 
)
inline

Perform a formatted hex-dump of the (potentially) binary data to the given stream.

Deprecated:
Set cfg.prefix and use the 3-parameter function instead.
Parameters
sstream to dump data to.
datadata to hex-dump.
tagstring to put at the beginning of each line of output.
cfgformatting configuration.

Definition at line 1416 of file StringUtils.hpp.

◆ hexDumpData() [3/3]

void gnsstk::StringUtils::hexDumpData ( std::ostream &  s,
const std::string &  data,
unsigned  indent = 0,
const HexDumpDataConfig cfg = HexDumpDataConfig() 
)
inline

Perform a formatted hex-dump of the (potentially) binary data to the given stream.

Deprecated:
Set cfg.prefix and use the 3-parameter function instead.
Parameters
sstream to dump data to.
datadata to hex-dump.
indentindents the string by that many spaces.
cfgformatting configuration.

Definition at line 1409 of file StringUtils.hpp.

◆ int2x()

std::string gnsstk::StringUtils::int2x ( const unsigned int &  i)
inline

Convert an int to a string.

Parameters
ithe integer to convert
Returns
a string with the hex equivalent of i
Exceptions
StringException

Definition at line 1830 of file StringUtils.hpp.

◆ isAlphaString()

bool gnsstk::StringUtils::isAlphaString ( const std::string &  s)
inline

isAlphaString is exactly like the C function isAlpha except it checks all the characters of string s to see if they are all alphabet characters.

Parameters
sthe string to check the characters in.
Returns
true if s is all digits, false otherwise.

Definition at line 1922 of file StringUtils.hpp.

◆ isDecimalString()

bool gnsstk::StringUtils::isDecimalString ( const std::string &  s)
inline

isDecimalString is like isDigitString() except it allows a single period ('.') character in the string.

Parameters
sthe string to check.
Returns
true if s is a valid fixed-point number.

Definition at line 1885 of file StringUtils.hpp.

◆ isDigitString()

bool gnsstk::StringUtils::isDigitString ( const std::string &  s)
inline

isDigitString is exactly like the C function isDigit except it checks all the characters of string s to see if they are all digits.

Parameters
sthe string to check the digits in.
Returns
true if s is all digits, false otherwise.

Definition at line 1871 of file StringUtils.hpp.

◆ isLike() [1/2]

bool gnsstk::StringUtils::isLike ( const std::string &  s,
const char *  pPattern,
const char  zeroOrMore = '*',
const char  oneOrMore = '+',
const char  anyChar = '.' 
)
inline

Perform pattern matching on strings. Looks for a pattern in a string. Wildcards are allowed. Uses POSIX regular expressions.

Parameters
sstring to search.
pPatternpattern to search for. This is a POSIX regular expression.
zeroOrMorecharacter representing wildcards matching strings of zero or more characters (default '*').
oneOrMorecharacter representing plus sign matching strings of one or more characters (default '+').
anyCharcharacter representing wildcards matching a single arbitrary character (default '.').
Returns
t if a match is found, f if not.
Exceptions
StringException

Definition at line 973 of file StringUtils.hpp.

◆ isLike() [2/2]

bool gnsstk::StringUtils::isLike ( const std::string &  s,
const std::string &  aPattern,
const char  zeroOrMore = '*',
const char  oneOrMore = '+',
const char  anyChar = '.' 
)
inline

Perform pattern matching on strings. Looks for a pattern in a string. Wildcards are allowed. Uses POSIX regular expressions.

Parameters
sstring to search.
aPatternpattern to search for. This is a POSIX regular expression.
zeroOrMorecharacter representing wildcards matching strings of zero or more characters (default '*').
oneOrMorecharacter representing plus sign matching strings of one or more characters (default '+').
anyCharcharacter representing wildcards matching a single arbitrary character (default '.').
Returns
t if a match is found, f if not.
Exceptions
StringException

Definition at line 948 of file StringUtils.hpp.

◆ isScientificString()

bool gnsstk::StringUtils::isScientificString ( const std::string &  s)
inline

isScientificString extends isDecimalString() to allow a single exponent (E,e,D,d) character between a decimal string and a (possibly empty) digit string.

Parameters
sthe string to check.
Returns
true if s is a valid scientific-notation number.

Definition at line 1908 of file StringUtils.hpp.

◆ leftJustify() [1/2]

std::string gnsstk::StringUtils::leftJustify ( const std::string &  s,
const std::string::size_type  length,
const char  pad = ' ' 
)
inline

Left-justifies the receiver in a string of the specified length (const version). If the new length (length) is larger than the current length, the string is extended by the pad character (pad). The default pad character is a blank.

Parameters
sstring to be modified.
lengthnew desired length of string.
padcharacter to pad string with (blank by default).
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 651 of file StringUtils.hpp.

◆ leftJustify() [2/2]

std::string & gnsstk::StringUtils::leftJustify ( std::string &  s,
const std::string::size_type  length,
const char  pad = ' ' 
)
inline

Left-justifies the receiver in a string of the specified length. If the new length (length) is larger than the current length, the string is extended by the pad character (pad). The default pad character is a blank.

Parameters
sstring to be modified.
lengthnew desired length of string.
padcharacter to pad string with (blank by default).
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 1582 of file StringUtils.hpp.

◆ lowerCase() [1/2]

std::string gnsstk::StringUtils::lowerCase ( const std::string &  s)
inline

Change all upper-case letters in a string to lower-case. Does not modify the original string.

Parameters
sa string containing upper-case characters.
Returns
a copy of the original string, all in lower-case.

Definition at line 1029 of file StringUtils.hpp.

◆ lowerCase() [2/2]

std::string & gnsstk::StringUtils::lowerCase ( std::string &  s)
inline

Change all upper-case letters in a string to lower-case. s is modified as a result.

Parameters
sstring to change to lower case.
Returns
a copy of the original string, all in lower-case.

Definition at line 2108 of file StringUtils.hpp.

◆ matches()

std::string gnsstk::StringUtils::matches ( const std::string &  s,
const std::string &  aPattern,
const char  zeroOrMore = '*',
const char  oneOrMore = '+',
const char  anyChar = '.' 
)
inline

Perform pattern matching on strings. Looks for a pattern in a string. Wildcards are allowed. Uses POSIX regular expressions.

Parameters
sstring to search.
aPatternpattern to search for. This is a POSIX regular expression.
zeroOrMorecharacter representing wildcards matching strings of zero or more characters (default '*').
oneOrMorecharacter representing plus sign matching strings of one or more characters (default '+').
anyCharcharacter representing wildcards matching a single arbitrary character (default '.').
Returns
string representing the first match of aPattern in s. Returns a null string if no match is found.
Exceptions
StringException

Definition at line 1934 of file StringUtils.hpp.

◆ memToString()

std::string gnsstk::StringUtils::memToString ( const void *  p,
const std::string::size_type  size 
)
inline

Make a string from a void pointer. This function should not be used. Instead, use the string constructor as follows:

string((char*)p, size);
Parameters
ppointer to memory.
sizelength of the data to turn into a string.
Returns
string object containing the contents of p.

Definition at line 2126 of file StringUtils.hpp.

◆ numWords()

int gnsstk::StringUtils::numWords ( const std::string &  s,
const char  delimiter = ' ' 
)
inline

Counts the number of words in s and returns it.

Parameters
sthe string to count the words from.
delimiterthe character that marks the start and end of a word.
Returns
the number of words in s.
Exceptions
StringException

Definition at line 2171 of file StringUtils.hpp.

◆ prettyPrint() [1/2]

std::string gnsstk::StringUtils::prettyPrint ( const std::string &  aStr,
const std::string &  lineDelim = "\n",
const std::string &  indent = "",
const std::string &  firstIndent = "     ",
const std::string::size_type  len = 80,
const char  wordDelim = ' ' 
)
inline

Const version of prettyPrint, which nicely expands the input string into several lines.

Parameters
aStrthe string to be modified.
lineDelima string to put between every line.
indentan indentataion string used on all but the first line
firstIndentis the indentation used on the first line.
lenthe maximum length of string to put on a line.
wordDelimthe character that separates each word.
Returns
the string nicely formatted.
Exceptions
StringException

Definition at line 1335 of file StringUtils.hpp.

◆ prettyPrint() [2/2]

std::string & gnsstk::StringUtils::prettyPrint ( std::string &  aStr,
const std::string &  lineDelim = "\n",
const std::string &  indent = "",
const std::string &  firstIndent = "     ",
const std::string::size_type  len = 80,
const char  wordDelim = ' ' 
)
inline

Nicely expands the input string into several lines, non-const version.

Parameters
aStrthe string to be modified.
lineDelima string to put between every line.
indentan indentataion string used on all but the first line
firstIndentis the indentation used on the first line.
lenthe maximum length of string to put on a line.
wordDelimthe character that separates each word.
Returns
the string nicely formatted.
Exceptions
StringException

Definition at line 2774 of file StringUtils.hpp.

◆ printable()

std::string gnsstk::StringUtils::printable ( const std::string &  aStr)
inline

Change a string into printable characters. Control characters 0, 1, ... 31 are changed to ^@, ^A, ... ^_ ; control character 127 is changed to ^? (as per Caret-notation). Other non-printable characters are changed to hex sequences enclosed in <>.

Parameters
aStrthe string to make printable.
Exceptions
StringException

Definition at line 2731 of file StringUtils.hpp.

◆ removeWords()

std::string & gnsstk::StringUtils::removeWords ( std::string &  s,
const std::string::size_type  first = 0,
const std::string::size_type  wordsToReplace = std::string::npos,
const char  delimiter = ' ' 
)
inline

Remove indicated words from the string s. s is modified as a result. Removal of a word begins at the start of the word and continues to include any delimiters between the end of the word and the start of the next word. If the last word in s is removed, all trailing delimiters are removed as well; if all words in s are removed, the resulting string is empty.

Parameters
sa string with words to be removed.
firstthe first word to be removed (the first word is 0).
wordsToReplacethe number of words to remove, or std::string::npos to remove all subsequent words
delimitercharacter that marks the start and end of words
Returns
a reference to string s with the words removed.
Exceptions
StringException

Definition at line 2429 of file StringUtils.hpp.

◆ replaceAll()

std::string & gnsstk::StringUtils::replaceAll ( std::string &  s,
const std::string &  oldString,
const std::string &  newString 
)
inline

Replace all instances of oldString with newString in s.

Parameters
sthe string whose contents will be modified.
oldStringthe string to search for in s.
newStringthe string to replace oldString in s.
Returns
a reference to the modified string.
Exceptions
StringException

Definition at line 1849 of file StringUtils.hpp.

◆ rightJustify() [1/2]

std::string gnsstk::StringUtils::rightJustify ( const std::string &  s,
const std::string::size_type  length,
const char  pad = ' ' 
)
inline

Right-justifies the receiver in a string of the specified length (const version). If the receiver's data is shorter than the requested length (length), it is padded on the left with the pad character (pad). The default pad character is a blank.

Parameters
sstring to be modified.
lengthnew desired length of string.
padcharacter to pad string with (blank by default).
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 620 of file StringUtils.hpp.

◆ rightJustify() [2/2]

std::string & gnsstk::StringUtils::rightJustify ( std::string &  s,
const std::string::size_type  length,
const char  pad = ' ' 
)
inline

Right-justifies the receiver in a string of the specified length. If the receiver's data is shorter than the requested length (length), it is padded on the left with the pad character (pad). The default pad character is a blank.

Parameters
sstring to be modified.
lengthnew desired length of string.
padcharacter to pad string with (blank by default).
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 1557 of file StringUtils.hpp.

◆ sci2for()

std::string & gnsstk::StringUtils::sci2for ( std::string &  aStr,
const std::string::size_type  startPos = 0,
const std::string::size_type  length = std::string::npos,
const std::string::size_type  expLen = 3,
const bool  checkSwitch = true 
)
inline

Convert scientific notation to FORTRAN notation. As an example, the string "1.5636E5" becomes " .15636D6". Note that the first character of the string will be '-' if the number is negative or ' ' if the first character is positive.

Parameters
aStrstring with number to convert
startPosstart position of number in string
lengthlength (in characters) of number, including exponent.
expLenlength (in characters of exponent, not including sign.
checkSwitchwill keep the method running as originally programmed when set to true. If false, the method will always resize exponentials, produce an exponential with an E instead of a D, and always have a leading zero. For example -> 0.87654E-0004 or -0.1234E00005.
Exceptions
StringExceptionif the string is not a number in scientific notation
Deprecated:
This method is being replaced by FormattedDouble and is scheduled for removal in the first tagged release of Q4 2020.

Definition at line 2566 of file StringUtils.hpp.

◆ split() [1/2]

std::vector< std::string > gnsstk::StringUtils::split ( const std::string &  aStr,
const std::string &  theDelimiters,
bool  trimWhitespace = false,
bool  ignoreEmpty = true 
)
inline

Split a string by some delimiters

Parameters
aStrthe string to be split
theDelimitersthe delimiters to split the string
trimWhitespacewill trim the token string, default is false
ignoreEmptywill ignore the empty tokens, default is true

Definition at line 2297 of file StringUtils.hpp.

◆ split() [2/2]

std::vector< std::string > gnsstk::StringUtils::split ( const std::string &  str,
const char  delimiter = ' ' 
)
inline

Split a string str into words as defined by delimiter.

Parameters
strstring to be parsed.
delimitercharacter that marks the start and end of a word.
Returns
a vector of the words (strings)
Exceptions
StringException

Definition at line 2275 of file StringUtils.hpp.

◆ splitWithDoubleQuotes()

std::vector< std::string > gnsstk::StringUtils::splitWithDoubleQuotes ( const std::string &  aStr,
const char  delimiter = ' ',
bool  trimWhitespace = true,
bool  ignoreEmpty = true 
)
inline

Split a string on the given delimiter, respecting fields enclosed by a pair of double quotes. Quotes are removed in output, and optionally also leading and trailing whitespace.

Parameters
aStrthe string to be split
delimitercharacter delimiter (not ")
trimWhitespacewill trim the token string, default is true
ignoreEmptywill ignore the empty tokens, default is true

Definition at line 2376 of file StringUtils.hpp.

◆ splitWithQuotes()

std::vector< std::string > gnsstk::StringUtils::splitWithQuotes ( const std::string &  aStr,
const char  delimiter = ' ',
bool  trimWhitespace = true,
bool  ignoreEmpty = true 
)
inline

Split a string on the given delimiter, respecting fields enclosed by a pair of either single or double quotes. Quotes are removed in output, and optionally also leading and trailing whitespace.

Parameters
aStrthe string to be split
delimitercharacter delimiter (not ' or ")
trimWhitespacewill trim the token string, default is true
ignoreEmptywill ignore the empty tokens, default is true

Definition at line 2322 of file StringUtils.hpp.

◆ strip() [1/8]

std::string gnsstk::StringUtils::strip ( const std::string &  s,
const char *  pString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the beginning and end of another string cosnt version. Occurrences of the string pString appearing at the beginning and end of the string s are removed.

Parameters
sstring to be stripped (modified).
pStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 467 of file StringUtils.hpp.

◆ strip() [2/8]

std::string gnsstk::StringUtils::strip ( const std::string &  s,
const char  aCharacter,
std::string::size_type  num = std::string::npos 
)
inline

Strip character(s) from the beginning and end of a string const version. Occurrences of the character aCharacter appearing at the beginning and end of the string s are removed.

Parameters
sstring to be stripped (modified).
aCharactercharacter to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 497 of file StringUtils.hpp.

◆ strip() [3/8]

std::string gnsstk::StringUtils::strip ( const std::string &  s,
const std::string &  aString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the beginning and end of another string const version. Occurrences of the string aString appearing at the beginning and end of the string s are removed.

Parameters
sstring to be stripped (modified).
aStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 436 of file StringUtils.hpp.

◆ strip() [4/8]

std::string gnsstk::StringUtils::strip ( const std::string &  s,
std::string::size_type  num = std::string::npos 
)
inline

Strip blanks from the beginning and end of a string const version. Occurrences of the space character appearing at the beginning and end of the string s are removed.

Parameters
sstring to be stripped (modified).
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 524 of file StringUtils.hpp.

◆ strip() [5/8]

std::string& gnsstk::StringUtils::strip ( std::string &  s,
const char *  pString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the beginning and end of another string. Occurrences of the string pString appearing at the beginning and end of the string s are removed.

Parameters
sstring to be stripped (modified).
pStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 452 of file StringUtils.hpp.

◆ strip() [6/8]

std::string& gnsstk::StringUtils::strip ( std::string &  s,
const char  aCharacter,
std::string::size_type  num = std::string::npos 
)
inline

Strip character(s) from the beginning and end of a string. Occurrences of the character aCharacter appearing at the beginning and end of the string s are removed.

Parameters
sstring to be stripped (modified).
aCharactercharacter to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 482 of file StringUtils.hpp.

◆ strip() [7/8]

std::string & gnsstk::StringUtils::strip ( std::string &  s,
const std::string &  aString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the beginning and end of another string. Occurrences of the string aString appearing at the beginning and end of the string s are removed.

Parameters
sstring to be stripped (modified).
aStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 1482 of file StringUtils.hpp.

◆ strip() [8/8]

std::string& gnsstk::StringUtils::strip ( std::string &  s,
std::string::size_type  num = std::string::npos 
)
inline

Strip blanks from the beginning and end of a string. Occurrences of the space character appearing at the beginning and end of the string s are removed.

Parameters
sstring to be stripped (modified).
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 511 of file StringUtils.hpp.

◆ stripFirstWord()

std::string gnsstk::StringUtils::stripFirstWord ( std::string &  s,
const char  delimiter = ' ' 
)
inline

Removes the first word off string s and returns it. s is modified as a result.

Parameters
sa string with the word you want removed.
delimiterthe character that marks the start and end of a word.
Returns
the first word from s
Exceptions
StringException

Definition at line 2253 of file StringUtils.hpp.

◆ stripLeading() [1/8]

std::string gnsstk::StringUtils::stripLeading ( const std::string &  s,
const char *  pString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the beginning of another string const version. Occurrences of the string pString appearing at the beginning of the string s are removed.

Parameters
sstring to be stripped (modified).
pStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 235 of file StringUtils.hpp.

◆ stripLeading() [2/8]

std::string gnsstk::StringUtils::stripLeading ( const std::string &  s,
const char  aCharacter,
std::string::size_type  num = std::string::npos 
)
inline

Strip character(s) from the beginning of a string const version. Occurrences of the character aCharacter appearing at the beginning of the string s are removed.

Parameters
sstring to be stripped (modified).
aCharactercharacter to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 265 of file StringUtils.hpp.

◆ stripLeading() [3/8]

std::string gnsstk::StringUtils::stripLeading ( const std::string &  s,
const std::string &  aString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the beginning of another string const version. Occurrences of the string aString appearing at the beginning of the string s are removed.

Parameters
sstring to be stripped (modified).
aStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 205 of file StringUtils.hpp.

◆ stripLeading() [4/8]

std::string gnsstk::StringUtils::stripLeading ( const std::string &  s,
std::string::size_type  num = std::string::npos 
)
inline

Strip blanks from the beginning of a string const version. Occurrences of the space character appearing at the beginning of the string s are removed.

Parameters
sstring to be stripped (modified).
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 292 of file StringUtils.hpp.

◆ stripLeading() [5/8]

std::string& gnsstk::StringUtils::stripLeading ( std::string &  s,
const char *  pString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the beginning of another string. Occurrences of the string pString appearing at the beginning of the string s are removed.

Parameters
sstring to be stripped (modified).
pStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 220 of file StringUtils.hpp.

◆ stripLeading() [6/8]

std::string& gnsstk::StringUtils::stripLeading ( std::string &  s,
const char  aCharacter,
std::string::size_type  num = std::string::npos 
)
inline

Strip character(s) from the beginning of a string. Occurrences of the character aCharacter appearing at the beginning of the string s are removed.

Parameters
sstring to be stripped (modified).
aCharactercharacter to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 250 of file StringUtils.hpp.

◆ stripLeading() [7/8]

std::string & gnsstk::StringUtils::stripLeading ( std::string &  s,
const std::string &  aString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the beginning of another string. Occurrences of the string aString appearing at the beginning of the string s are removed.

Parameters
sstring to be stripped (modified).
aStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 1426 of file StringUtils.hpp.

◆ stripLeading() [8/8]

std::string& gnsstk::StringUtils::stripLeading ( std::string &  s,
std::string::size_type  num = std::string::npos 
)
inline

Strip blanks from the beginning of a string. Occurrences of the space character appearing at the beginning of the string s are removed.

Parameters
sstring to be stripped (modified).
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 279 of file StringUtils.hpp.

◆ stripTrailing() [1/8]

std::string gnsstk::StringUtils::stripTrailing ( const std::string &  s,
const char *  pString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the end of another string const version. Occurrences of the string pString appearing at the end of the string s are removed.

Parameters
sstring to be stripped (modified).
pStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 350 of file StringUtils.hpp.

◆ stripTrailing() [2/8]

std::string gnsstk::StringUtils::stripTrailing ( const std::string &  s,
const char  aCharacter,
std::string::size_type  num = std::string::npos 
)
inline

Strip character(s) from the end of a string const version. Occurrences of the character aCharacter appearing at the end of the string s are removed.

Parameters
sstring to be stripped (modified).
aCharactercharacter to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 380 of file StringUtils.hpp.

◆ stripTrailing() [3/8]

std::string gnsstk::StringUtils::stripTrailing ( const std::string &  s,
const std::string &  aString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the end of another string const version. Occurrences of the string aString appearing at the end of the string s are removed.

Parameters
sstring to be stripped (modified).
aStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 320 of file StringUtils.hpp.

◆ stripTrailing() [4/8]

std::string gnsstk::StringUtils::stripTrailing ( const std::string &  s,
std::string::size_type  num = std::string::npos 
)
inline

Strip blanks from the end of a string const version. Occurrences of the space character appearing at the end of the string s are removed.

Parameters
sstring to be stripped (modified).
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 407 of file StringUtils.hpp.

◆ stripTrailing() [5/8]

std::string& gnsstk::StringUtils::stripTrailing ( std::string &  s,
const char *  pString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the end of another string. Occurrences of the string pString appearing at the end of the string s are removed.

Parameters
sstring to be stripped (modified).
pStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 335 of file StringUtils.hpp.

◆ stripTrailing() [6/8]

std::string& gnsstk::StringUtils::stripTrailing ( std::string &  s,
const char  aCharacter,
std::string::size_type  num = std::string::npos 
)
inline

Strip character(s) from the end of a string. Occurrences of the character aCharacter appearing at the end of the string s are removed.

Parameters
sstring to be stripped (modified).
aCharactercharacter to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 365 of file StringUtils.hpp.

◆ stripTrailing() [7/8]

std::string & gnsstk::StringUtils::stripTrailing ( std::string &  s,
const std::string &  aString,
std::string::size_type  num = std::string::npos 
)
inline

Remove a string from the end of another string. Occurrences of the string aString appearing at the end of the string s are removed.

Parameters
sstring to be stripped (modified).
aStringstring to remove.
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 1453 of file StringUtils.hpp.

◆ stripTrailing() [8/8]

std::string& gnsstk::StringUtils::stripTrailing ( std::string &  s,
std::string::size_type  num = std::string::npos 
)
inline

Strip blanks from the end of a string. Occurrences of the space character appearing at the end of the string s are removed.

Parameters
sstring to be stripped (modified).
nummaximum number of occurrences to remove.
Exceptions
StringExceptionif there's a std::exception thrown.
Returns
a reference to s.

Definition at line 394 of file StringUtils.hpp.

◆ subString()

std::string gnsstk::StringUtils::subString ( const std::string &  s,
const std::string::size_type  startPos = 0,
const std::string::size_type  length = std::string::npos,
const char  pad = ' ' 
)
inline

Get a substring of a string. Try to avoid using this, use the stl string's substr method instead (and leftJustify if needed).

Exceptions
StringException

Definition at line 2083 of file StringUtils.hpp.

◆ tabularize()

std::string gnsstk::StringUtils::tabularize ( const std::vector< std::string > &  cells,
std::string::size_type  width = 80,
bool  force = false 
)
inline

Create a table in text consisting of cells organized in row-major order. Output is space separated, and columns widths are adjusted to accomodate the maximum size of the cells.

Parameters
[in]cellsThe table cells to format.
[in]widthThe maximum number of characters per row.
[in]forceIf true, width is always used to govern the table width, otherwise an attempt is made to determine the console width to use instead (falling back on width).
Returns
A string containing the table, with newlines etc.

Definition at line 2835 of file StringUtils.hpp.

◆ translate()

std::string gnsstk::StringUtils::translate ( const std::string &  aString,
const std::string &  inputChars,
const std::string &  outputChars,
const char  pad = ' ' 
)
inline

Converts all of the receiver's characters that are in the first specified string to the corresponding character in the second specified string.

Parameters
aStringstring to perform translation on.
inputCharscharacters in aString to translate from.
outputCharscharacters to translate to.
padpad character in the event inputChars and outputChars are not equal length. The pad character will become the translated character.

Definition at line 1491 of file StringUtils.hpp.

◆ upperCase() [1/2]

std::string gnsstk::StringUtils::upperCase ( const std::string &  s)
inline

Change all lower-case letters in a string to upper-case. Does not modify the original string.

Parameters
sa string containing lower-case characters.
Returns
a copy of the original string, all in upper-case.

Definition at line 1046 of file StringUtils.hpp.

◆ upperCase() [2/2]

std::string & gnsstk::StringUtils::upperCase ( std::string &  s)
inline

Change all lower-case letters in a string to upper-case. s is modified as a result.

Parameters
sstring to change to upper case.
Returns
a copy of the original string, all in upper-case.

Definition at line 2117 of file StringUtils.hpp.

◆ word()

std::string gnsstk::StringUtils::word ( const std::string &  s,
const std::string::size_type  wordNum = 0,
const char  delimiter = ' ' 
)
inline

Returns word number wordNum from s (if any).

Parameters
sa string with the word you want removed.
wordNumthe number of the word you want from s. The first word is word 0.
delimiterthe character that marks the start and end of a word.
Returns
the first word from s or an empty string if there is no wordNum'th word.
Exceptions
StringException

Definition at line 1112 of file StringUtils.hpp.

◆ words()

std::string gnsstk::StringUtils::words ( const std::string &  s,
const std::string::size_type  firstWord = 0,
const std::string::size_type  numWords = std::string::npos,
const char  delimiter = ' ' 
)
inline

Returns numWords words starting with firstWord from s (if any).

Parameters
sa string with the word you want removed.
firstWordthe number of the first word you want from s. The first word is word 0.
numWordsnumber of words to get from s.
delimiterthe character that marks the start and end of a word.
Returns
the first word from s or an empty string if there is no wordNum'th word.
Exceptions
StringException

Definition at line 2199 of file StringUtils.hpp.

◆ x2d() [1/2]

std::string gnsstk::StringUtils::x2d ( const std::string &  s)
inline

Convert a hexadecimal string to a decimal string. Given a string containing a hexadecimal number, convert the integer from base 16 to base 10 and return the result. Only the first hex number encountered is changed; the rest of the string is unmodified.

Parameters
sstring containing an integer.
Returns
string containing a hexadecimal number.
Exceptions
StringException

Definition at line 823 of file StringUtils.hpp.

◆ x2d() [2/2]

std::string & gnsstk::StringUtils::x2d ( std::string &  s)
inline

Convert a hexadecimal string to a decimal string. Modify the string such that the hexadecimal number is now represented as decimal. Only the first hex number encountered is changed; the rest of the string is unmodified.

Parameters
sstring containing an integer.
Returns
reference to modified s.
Exceptions
StringException
Todo:
detecting 0 isn't quite right...

Definition at line 1797 of file StringUtils.hpp.

◆ x2uint()

unsigned int gnsstk::StringUtils::x2uint ( const std::string &  s)
inline

Convert a hexadecimal string to an unsigned int. Only the first hex number encountered is converted.

Parameters
sstring containing a hex integer.
Returns
a long holding the value of s.
Exceptions
StringException
Todo:
Need to find a way to combine this with x2d.

Definition at line 1773 of file StringUtils.hpp.



gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:46