USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::iString Class Reference
[Parsing]

#include <iString.h>

Inheritance diagram for Isis::iString:

Inheritance graph
[legend]
Collaboration diagram for Isis::iString:

Collaboration graph
[legend]
List of all members.

Detailed Description

Adds specific functionality to C++ strings.

This class extends the standard C++ string class with specific functionality useable by ISIS programmers.

Author:
2002-09-10 Stuart Sides

For internal use only.

History:
2003-02-05 Jeff Anderson - Modified the constructor routine which accepts a type of double (i.e., conversion of a double to a string). The constructor now generates nice output as indicated in the documentation.
History:
2003-05-16 Stuart Sides - Modified schema from astrogeology... isis.astrogeology...
History:
2003-05-30 Jeff Anderson - Updated unitTest and truth file to account for optimzation changes
History:
2003-05-30 Stuart Sides - Modified conversion of double to string constructor to output 14 place of accuracy
History:
2003-06-24 Stuart Sides - Modified UpCase and DownCase to use the transform from the STL instead of looping and converting individual chars
History:
2003-06-25 Stuart Sides - Added member function to remove all characters which are in the parameter from the object string (Remove)
History:
2003-06-25 Stuart Sides - Added documentation for new member (Remove)
History:
2003-07-17 Stuart Sides - Fixed bug in Convert. It sometimes would not convert any characters even though it should have. find_first_of should be "!=npos" instead of ">0".
History:
2003-08-14 Stuart Sides - Fixed bug in Token. It would not parse "a","b" correctly.
History:
2004-02-20 Stuart Sides - Added ability for ToDouble to convert PDS hex values to a double
History:
2004-04-14 Jeff Anderson - Added (int) (double) and (string) cast conversions and operator= methods
History:
2005-02-15 Elizabeth Ribelin - Modified file to support Doxygen documentation
History:
2005-05-20 Jeff Anderson - Added BigInt methods
History:
2006-01-23 Jacob Danton - Changed the scientific notation start value (from 0.1 to 0.0001)
History:
2007-06-05 Brendan George - Merged with StringTools
History:
2007-07-17 Steven Lambright - Fixed bug where -0.0 would result in SetDouble
History:
2007-07-25 Steven Koechle - Fixed a bug where one of the TrimTail methods was calling erase incorrectly.
History:
2008-02-08 Steven Koechle - Keeps Convert from infinite looping
History:
2008-02-22 Steven Koechle - Added a Replace method that honors quotes
History:
2008-06-12 Jeannie Walldren - Fixed a bug in Compress method so that it is able to deal with multiple quotations within the string
History:
2008-06-18 Stuart Sides - Fixed doc error
History:
2005-02-15 Stuart Sides - add coded and implementation examples to class documentation and document iString(const char *str), and private methods
History:
2008-07-14 Steven Lambright - Made some members const
History:
2008-07-16 Steven Lambright - Added support for double nans and inifinities
Todo:
The Token member should consider single and double quotes seperatly

Definition at line 106 of file iString.h.

Public Member Functions

 iString ()
 Constructs an empty iString object.
 iString (const std::string &str)
 Constructs a iString object with initial value set to the string argument.
 iString (const iString &str)
 Constructs a iString with initial value set to the iString argument.
 iString (const char *str)
 Constructs a iString with initial value set to the argument.
 iString (const int &num)
 Constructs a iString object with its initial value set to the string representation of the int argument.
 iString (const double &num)
 Constructs a iString object with its initial value set to the string representation of the double argument.
 iString (const BigInt &num)
 Constructs a iString object with its initial value set to the string representation of the BigInt argument.
 iString (const QString &str)
 Constructs a iString object with initial value set to the input QString.
 ~iString ()
 Destructor.
iString Trim (const std::string &chars)
 Removes characters from the beginning and end of the iString.
iString TrimHead (const std::string &chars)
 Trims The input characters from the beginning of the object iString.
iString TrimTail (const std::string &chars)
 Trims the input characters from the end of the object iString.
iString UpCase ()
 Converst any lower case characters in the object iString with uppercase characters.
iString DownCase ()
 Converts all upper case letters in the object iString into lower case characters.
int ToInteger () const
 Returns the object string as an integer.
BigInt ToBigInteger () const
 Returns the BigInt representation of the object iString.
double ToDouble () const
 Returns the floating point value the iString represents.
QString ToQt () const
 Retuns the object string as a QString.
iString Token (const iString &separator)
 Returns the first token in the iString.
iString Compress (bool force=false)
 Collapses multiple spaces into single spaces.
iString Replace (const std::string &from, const std::string &to, int maxReplaceCount=20)
 Replaces all instances of the first input string with the second input string.
iString Replace (const std::string &from, const std::string &to, bool honorquotes)
 Replaces all instances of the first input string with the second input string.
iString Convert (const std::string &listofchars, const char &to)
 Returns the string with all occurrences of any character in the "from" argument converted to the "to" argument.
iString ConvertWhiteSpace ()
 Returns the string with all "new lines", "carriage returns", "tabs", "form feeds", "vertical tabs" and "back spaces" converted to single spaces.
iString Remove (const std::string &del)
 Remove all instances of any character in the string from the iString.
 operator int () const
 Attempts to convert the stirng to a 32 bit integer and return that int.
 operator BigInt () const
 Attempts to convert the stirng to a 64 bit integer and return that int.
 operator double () const
 Attempts to convert the stirng to a 64 bit double and return that double.
 operator QString () const
 Attempts to convert the stirng to a QStirng (Qt) and return that QString.
iStringoperator= (const int &value)
 Attempts to convert a 32 bit integer into its string representation.
iStringoperator= (const BigInt &value)
 Attempts to convert a 64 bit integer into its string representation.
iStringoperator= (const double &value)
 Attempts to convert double into its string representation.
bool Equal (const std::string &str) const
 Compare a string to the object iString.

Static Public Member Functions

static std::string Trim (const std::string &chars, const std::string &str)
 Removes all occurences of the input characters from the beginning and end of the input string.
static std::string TrimHead (const std::string &chars, const std::string &str)
 Trims the input characters from the beginning of the input string.
static std::string TrimTail (const std::string &chars, const std::string &str)
 Trims the input characters from the end of the input string.
static std::string UpCase (const std::string &str)
 Converts lower case characters in the input string to upper case characters.
static std::string DownCase (const std::string &str)
 Converts all upper case letters in the input string into lower case characters.
static int ToInteger (const std::string &str)
 Returns the integer representation of the input string.
static BigInt ToBigInteger (const std::string &str)
 Returns the Big Integer representation of the input string.
static double ToDouble (const std::string &str)
 Returns the floating-point value represented by the input string.
static QString ToQt (const std::string &str)
 Resturns the input string as a QString.
static int Split (const char separator, const std::string &instr, std::vector< std::string > &tokens, bool allowEmptyEntries=true)
 Find separators between characters and split them into strings.
static std::string Compress (const std::string &str, bool force=false)
 Returns the input string with multiple spaces collapsed into single spaces.
static std::string Replace (const std::string &str, const std::string &from, const std::string &to, int maxReplacementCount=20)
 Replace specified substring with replacement substring in a string.
static iString Replace (const std::string &str, const std::string &from, const std::string &to, bool honorquotes)
 Replace specified substring with replacement substring in a string honoring quotes if requested.
static std::string Convert (const std::string &str, const std::string &listofchars, const char &to)
 Converts all occurences in the input string of any character in the "from" string to the "to" character.
static std::string ConvertWhiteSpace (const std::string &str)
 Converts all forms of whitespace in the input string into single spaces.
static std::string Remove (const std::string &del, const std::string &str)
 Remove all instances of any character in the "del" argument from the input string.
static bool Equal (const std::string &str1, const std::string &str2)
 Compare two strings, case-insensitive.
static std::string ToStd (const QString &str)
 Converts a Qt string into a std::string.
static QStringList ToQt (const std::vector< std::string > &sl)
 Converts a vector of strings into a QStringList.
static std::vector< std::string > ToStd (const QStringList &sl)
 Converts a QStringList into a vector of strings.

Private Member Functions

void SetDouble (const double &value)
 Performs the conversion necessary to represent a floating-point value as a string.


Constructor & Destructor Documentation

Isis::iString::iString (  ) 

Constructs an empty iString object.

Definition at line 40 of file iString.cpp.

Referenced by Replace().

Isis::iString::iString ( const std::string &  str  ) 

Constructs a iString object with initial value set to the string argument.

Parameters:
str The initial value of the iString

Definition at line 49 of file iString.cpp.

Isis::iString::iString ( const iString str  ) 

Constructs a iString with initial value set to the iString argument.

Parameters:
str The initial value of the iString

Definition at line 57 of file iString.cpp.

Isis::iString::iString ( const char *  str  ) 

Constructs a iString with initial value set to the argument.

Parameters:
str The inital value of the iString

Definition at line 65 of file iString.cpp.

Isis::iString::iString ( const int &  num  ) 

Constructs a iString object with its initial value set to the string representation of the int argument.

Parameters:
num The initial value of the iString. The integer value is converted to a string representation and stored as the value.

Definition at line 75 of file iString.cpp.

References str.

Isis::iString::iString ( const double &  num  ) 

Constructs a iString object with its initial value set to the string representation of the double argument.

Parameters:
num The initial value of the iString. The double value is converted to a string representation and stored as the value. The conversion is handled in the following manner: If (abs(num) < 0.1) it is presented in scientific notation If (abs(log10(num)) < 16) it is presented in normal notation if (abs(log10(num)) >= 16) it is presented in scientific notation Trailing zeros are removed such that 5.000 is presented as 5.0

Definition at line 106 of file iString.cpp.

References SetDouble().

Isis::iString::iString ( const BigInt num  ) 

Constructs a iString object with its initial value set to the string representation of the BigInt argument.

Parameters:
num The initial value of the iString. The integer value is converted to a string representation and stored as the value.

Definition at line 88 of file iString.cpp.

References str.

Isis::iString::iString ( const QString &  str  ) 

Constructs a iString object with initial value set to the input QString.

Parameters:
str 

Definition at line 223 of file iString.cpp.

Isis::iString::~iString (  ) 

Destructor.

Definition at line 230 of file iString.cpp.


Member Function Documentation

std::string Isis::iString::Compress ( const std::string &  str,
bool  force = false 
) [static]

Returns the input string with multiple spaces collapsed into single spaces.

Parameters:
str The string to be compressed
force Determines whether to compress inside quotes
Returns:
string The compressed version of the input string

Definition at line 670 of file iString.cpp.

iString Isis::iString::Compress ( bool  force = false  ) 

Collapses multiple spaces into single spaces.

Parameters:
force Determines whether to compress inside quotes (single and double)

Definition at line 656 of file iString.cpp.

Referenced by KernelDb::FindAll(), spiceInit::kernelTypeEnum(), Isis::UserInterface::LoadBatchList(), and Isis::operator>>().

string Isis::iString::Convert ( const std::string &  str,
const std::string &  listofchars,
const char &  to 
) [static]

Converts all occurences in the input string of any character in the "from" string to the "to" character.

Parameters:
str The input string
listofchars The string of characters to be replaced. The order of the characters is unimportant
to The single character used as replacement
Returns:
string The converted string (the input string is unmodified)

Definition at line 876 of file iString.cpp.

References pos.

iString Isis::iString::Convert ( const std::string &  listofchars,
const char &  to 
)

Returns the string with all occurrences of any character in the "from" argument converted to the "to" argument.

The original string is modified.

Parameters:
listofchars The string of characters to be replaced. The order of the characters is not important.
to The single character used as the replacement.
Returns:
iString

Definition at line 858 of file iString.cpp.

Referenced by ConvertWhiteSpace(), Cassini::IssNACamera::IssNACamera(), and Cassini::IssWACamera::IssWACamera().

std::string Isis::iString::ConvertWhiteSpace ( const std::string &  str  )  [static]

Converts all forms of whitespace in the input string into single spaces.

Parameters:
str 
Returns:
string

Definition at line 908 of file iString.cpp.

References Convert().

iString Isis::iString::ConvertWhiteSpace (  ) 

Returns the string with all "new lines", "carriage returns", "tabs", "form feeds", "vertical tabs" and "back spaces" converted to single spaces.

All quotes are ignored. The original string is modified.

Returns:
iString

Definition at line 896 of file iString.cpp.

Referenced by KernelDb::FindAll(), Isis::Mgs::MocLabels::InitWago(), spiceInit::kernelTypeEnum(), Isis::operator>>(), and Isis::PvlKeyword::StringEqual().

std::string Isis::iString::DownCase ( const std::string &  str  )  [static]

Converts all upper case letters in the input string into lower case characters.

Parameters:
str 
Returns:
string

Definition at line 357 of file iString.cpp.

iString Isis::iString::DownCase (  ) 

Converts all upper case letters in the object iString into lower case characters.

Definition at line 344 of file iString.cpp.

Referenced by Isis::CissLabels::InstrumentModeId(), Isis::NoCaseStringCompare< K >::operator()(), Isis::ProcessImportPds::ProcessPdsImageLabel(), Isis::ProcessImportPds::ProcessPdsQubeLabel(), Isis::SqlRecord::QtTypeField(), IsisXMLApplication::startElement(), Isis::InfixToPostfix::TokenizeEquation(), Isis::Gui::UpdateCommandLine(), and IsisAml::Verify().

bool Isis::iString::Equal ( const std::string &  str1,
const std::string &  str2 
) [static]

Compare two strings, case-insensitive.

Parameters:
str1 [in] The first string to compare
str2 [in] The second string to compare
Returns:
True if the two input strings are identical otherwise false

Definition at line 397 of file iString.cpp.

References Isis::nocase_compare().

bool Isis::iString::Equal ( const std::string &  str  )  const

Compare a string to the object iString.

Parameters:
str The string with which the comparison is made
Returns:
bool True if they are equal, false if they are not.

Definition at line 384 of file iString.cpp.

Referenced by Isis::CSVReader::getColumn(), Qisis::MosaicWidget::readProject(), Isis::DatabaseFactory::remove(), and Qisis::MosaicItem::setUpItem().

Isis::iString::operator BigInt (  )  const [inline]

Attempts to convert the stirng to a 64 bit integer and return that int.

Returns:
BigInt

Definition at line 190 of file iString.h.

References ToBigInteger().

Isis::iString::operator double (  )  const [inline]

Attempts to convert the stirng to a 64 bit double and return that double.

Returns:
double

Definition at line 197 of file iString.h.

References ToDouble().

Isis::iString::operator int (  )  const [inline]

Attempts to convert the stirng to a 32 bit integer and return that int.

Returns:
int

Definition at line 182 of file iString.h.

References ToInteger().

Isis::iString::operator QString (  )  const [inline]

Attempts to convert the stirng to a QStirng (Qt) and return that QString.

Returns:
QString

Definition at line 204 of file iString.h.

References ToQt().

iString& Isis::iString::operator= ( const double &  value  )  [inline]

Attempts to convert double into its string representation.

Parameters:
value [in] The double to be converted to a string
Returns:
The Isis::iString representation of the double

Definition at line 217 of file iString.h.

References SetDouble().

iString & Isis::iString::operator= ( const BigInt value  ) 

Attempts to convert a 64 bit integer into its string representation.

Parameters:
value [in] The 64 bit integer to be converted to a string
Returns:
The Isis::iString representation of the BigInt

Definition at line 965 of file iString.cpp.

References str.

iString & Isis::iString::operator= ( const int &  value  ) 

Attempts to convert a 32 bit integer into its string representation.

Parameters:
value [in] The 32 bit integer to be converted to a string
Returns:
The Isis::iString representation of the int

Definition at line 951 of file iString.cpp.

References str.

std::string Isis::iString::Remove ( const std::string &  str,
const std::string &  del 
) [static]

Remove all instances of any character in the "del" argument from the input string.

Parameters:
str The string from which characters are to be removed
del The string of characters to be removed. Order is unimportant.
Returns:
string The string with the characters removed. The original string is unmodified

Definition at line 937 of file iString.cpp.

References pos.

iString Isis::iString::Remove ( const std::string &  del  ) 

Remove all instances of any character in the string from the iString.

Parameters:
del The characters to be removed from the iString. The character is unimportant
Returns:
iString

Definition at line 920 of file iString.cpp.

References pos.

Referenced by Isis::CameraFactory::CameraVersion(), Isis::InfixToPostfix::CheckArgument(), Isis::InfixToPostfix::Convert(), Isis::CameraFactory::Create(), Isis::Mgs::MocLabels::InitWago(), Isis::UserInterface::LoadBatchList(), Isis::PvlKeyword::StringEqual(), and Isis::ToKeywordType().

iString Isis::iString::Replace ( const std::string &  str,
const std::string &  from,
const std::string &  to,
bool  honorquotes 
) [static]

Replace specified substring with replacement substring in a string honoring quotes if requested.

This routine is case sensitive and will only replace exact matches.

Parameters:
str Input string to search and replace substrings in
from Search string that when found in str, it is replaced with to.
to iString that will replace every occurance of from in str.
honorquotes Set to true to honor quotes and not replace inside them
Returns:
iString New string with subTarg replaced with subRep

Definition at line 815 of file iString.cpp.

iString Isis::iString::Replace ( const std::string &  from,
const std::string &  to,
bool  honorquotes 
)

Replaces all instances of the first input string with the second input string.

Honoring quotes if requested by the boolean

Parameters:
from Search string that when found in str, it is replaced with to.
to iString that will replace every occurance of from in str.
honorquotes Set to true to honor quotes and not replace inside them
Returns:
iString New string with subTarg replaced with subRep

Definition at line 793 of file iString.cpp.

References Replace().

std::string Isis::iString::Replace ( const std::string &  str,
const std::string &  from,
const std::string &  to,
int  maxReplaceCount = 20 
) [static]

Replace specified substring with replacement substring in a string.

This method accepts a string, a target substring and a replacement substring with the intent to find all occurances of the subTarg substring in s and replace them with the substring subRep. The maxReplaceCount parameter is so that a should the replacement substring contain the target substring, an infinite loop would occur.

Note that the search for strings are implemented as a loop that always starts at the begining of s. So should the above scenario occur, it will be limited.

I have found this useful for formulating database SQL queries in a loop. The following example illustrates this usage:

   string pntDist  = "distance(giscpt,UPCPoint(%longitude,%latitude))";
   string pntQuery = "SELECT pointid, latitude, longitude, radius, "
                     " %distance AS Distance FROM "  + pntTable +
                     " WHERE (%distance <= " + iString(maxDist) + ")";
 
 SqlQuery finder;  // Uses whatever the default database is
 while (!theEndOfTime()) {
    iString longitude(source.getLongitude());
    iString latitude(source.getLatitude());
 
    string qDist = StringTools::replace(pntDist,"%longitude", longitude);
    qDist = StringTools::replace(qDist,"%latitude", latitude);
    string query = StringTools::replace(pntQuery, "%distance", qDist);
    finder.exec(query);
    ... //  Do what you will with the results!
 }

This routine is case sensitive and will only replace exact matches.

To prevent infinite recursion, where the replace string contains the search string, use the maxReplaceCount to adjust appropriately.

Parameters:
str Input string to search and replace substrings
from Search string that when found in str, it is replaced with to
to iString that will replace every occurance of from in str.
maxReplaceCount Maximum number of replacements to allow per call
Returns:
std::string NEw string with from replaced with to

Definition at line 763 of file iString.cpp.

References pos.

iString Isis::iString::Replace ( const std::string &  from,
const std::string &  to,
int  maxReplaceCount = 20 
)

Replaces all instances of the first input string with the second input string.

For more information, see iString::Replace(const string, const string, const string, int)

Parameters:
from Search string that when found in str, it is replaced with to
to iString that will replace every occurance of from in str.
maxReplaceCount Maximum number of replacements to allow per call

Definition at line 711 of file iString.cpp.

References iString().

Referenced by Isis::UserInterface::LoadBatchList(), and Replace().

void Isis::iString::SetDouble ( const double &  num  )  [private]

Performs the conversion necessary to represent a floating-point value as a string.

See iString (const double &num) for details

Parameters:
num The input value to be stored

Definition at line 116 of file iString.cpp.

References e.

Referenced by iString(), and operator=().

int Isis::iString::Split ( const char  separator,
const std::string &  str,
std::vector< std::string > &  tokens,
bool  allowEmptyEntries = true 
) [static]

Find separators between characters and split them into strings.

This method will break up the input string into tokens that are separated by one or more of the specified character. If allowEmptyEntries == true, then one or separator characters are deem a single separator and the string is split into two different sections. If allowEmptyEntries == false, then should more than one separator character occur in succession, this will result in the number of separator characters less one empty strings returned to the caller.

Parameters:
separator A single character that separates each substring
str The string to break into separate fields or tokens
tokens A vector of strings that will receive the tokens as separated by the separator character.
allowEmptyEntries If true, treat successive separator characters as a single separator. If false, successive separator characters result in empty strings/tokens.
Returns:
int The number of fields/tokens found in str

Definition at line 626 of file iString.cpp.

Referenced by Isis::CSVParser< TokenStore >::parse().

BigInt Isis::iString::ToBigInteger ( const std::string &  str  )  [static]

Returns the Big Integer representation of the input string.

Parameters:
str The string representing an integer value
Returns:
BigInt The string as a BigInt

Definition at line 454 of file iString.cpp.

References _FILEINFO_, and Isis::iException::Message().

BigInt Isis::iString::ToBigInteger (  )  const

Returns the BigInt representation of the object iString.

Returns:
BigInt The Big Integer representation of the iString

Definition at line 443 of file iString.cpp.

Referenced by operator BigInt().

double Isis::iString::ToDouble ( const std::string &  str  )  [static]

Returns the floating-point value represented by the input string.

Parameters:
str The string representing the numeric value
Returns:
double The number the string represents

Definition at line 489 of file iString.cpp.

References _FILEINFO_, and Isis::iException::Message().

double Isis::iString::ToDouble (  )  const

Returns the floating point value the iString represents.

Returns:
double The iString as a double

Definition at line 478 of file iString.cpp.

Referenced by Isis::iTime::Extract(), Isis::Cassini::VimsSkyMap::Init(), Isis::Cassini::VimsGroundMap::Init(), Isis::Mgs::MocLabels::InitWago(), Isis::Stretch::NextPair(), operator double(), Isis::CubeAttributeOutput::Parse(), Isis::CubeCalculator::PrepareCalculations(), Isis::StringToPixel(), and Isis::Cassini::VimsCamera::VimsCamera().

int Isis::iString::ToInteger ( const std::string &  str  )  [static]

Returns the integer representation of the input string.

Parameters:
str The string representing an integer value
Returns:
int The integer value represented by the string

Definition at line 419 of file iString.cpp.

References _FILEINFO_, and Isis::iException::Message().

int Isis::iString::ToInteger (  )  const

Returns the object string as an integer.

Returns:
int The integer te string represents

Definition at line 408 of file iString.cpp.

Referenced by Isis::iTime::Extract(), KernelDb::FindAll(), operator int(), Isis::CubeAttributeInput::Parse(), Isis::ProcessImportPds::ProcessPdsImageLabel(), Isis::ProcessImportPds::ProcessPdsQubeLabel(), and Isis::ProcessImportVicar::SetVicarFile().

iString Isis::iString::Token ( const iString separator  ) 

Returns the first token in the iString.

A token is defined as a string of characters from the beginning of the string to, but not including, the first character matching any character in the separator string. The token is removed from the original string along with the separator.

Parameters:
separator The string of characters used to separate tokens. The order of the characters is not important.
Returns:
iString

Definition at line 565 of file iString.cpp.

References pos.

Referenced by Isis::PvlKeyword::AddCommentWrapped(), Isis::InfixToPostfix::CleanSpaces(), Isis::InfixToPostfix::Convert(), KernelDb::FindAll(), Isis::InfixToPostfix::FormatFunctionCalls(), Isis::PvlTranslationManager::GetContainer(), Isis::ImageOverlap::ImageOverlap(), Isis::Cassini::VimsSkyMap::Init(), Isis::Cassini::VimsGroundMap::Init(), Isis::UserInterface::LoadBatchList(), Isis::Stretch::NextPair(), Isis::operator<<(), Isis::CubeAttributeOutput::Parse(), Isis::CubeAttributeInput::Parse(), Isis::CubeCalculator::PrepareCalculations(), Isis::FileList::Read(), Qisis::SocketThread::run(), Isis::Pipeline::Run(), and Isis::Cassini::VimsCamera::VimsCamera().

QStringList Isis::iString::ToQt ( const std::vector< std::string > &  sl  )  [static]

Converts a vector of strings into a QStringList.

Parameters:
sl STL vector of strings
Returns:
QStringList

Definition at line 990 of file iString.cpp.

References ToQt().

QString Isis::iString::ToQt ( const std::string &  s  )  [static]

Resturns the input string as a QString.

Parameters:
s [in] The standard string to be converted to a Qt string

Definition at line 550 of file iString.cpp.

QString Isis::iString::ToQt (  )  const

Retuns the object string as a QString.

Definition at line 541 of file iString.cpp.

Referenced by Isis::Database::configureAccess(), Isis::DatabaseFactory::create(), Isis::DatabaseFactory::destroy(), Isis::SqlQuery::exec(), Isis::SqlQuery::fieldIndex(), Isis::SqlRecord::getFieldIndex(), Isis::SqlRecord::getType(), Isis::SqlRecord::getValue(), Isis::SqlRecord::hasField(), Isis::DatabaseFactory::isConnected(), Isis::DatabaseFactory::isDriverAvailable(), Isis::SqlRecord::isNull(), operator QString(), and ToQt().

std::vector< std::string > Isis::iString::ToStd ( const QStringList &  sl  )  [static]

Converts a QStringList into a vector of strings.

Parameters:
sl 
Returns:
vector<string>

Definition at line 1005 of file iString.cpp.

References ToStd().

std::string Isis::iString::ToStd ( const QString &  str  )  [static]

Converts a Qt string into a std::string.

Parameters:
str [in] The Qt string to be converted to a std::string
Returns:
The std::string representation of the Qt string

Definition at line 979 of file iString.cpp.

Referenced by Isis::SqlQuery::fieldName(), Isis::SqlQuery::fieldNameList(), Isis::SqlRecord::getFieldName(), Isis::SqlQuery::getQuery(), Isis::DatabaseFactory::getResourceList(), Isis::Database::getSystemTables(), Isis::Database::getTables(), Isis::SqlRecord::getValue(), Isis::Database::getViews(), Isis::Database::tossDbError(), Isis::SqlQuery::tossQueryError(), and ToStd().

std::string Isis::iString::Trim ( const std::string &  chars,
const std::string &  str 
) [static]

Removes all occurences of the input characters from the beginning and end of the input string.

Parameters:
chars The string of characters to be removed. Order makes no difference
str The input string to be trimmed
Returns:
string The result of the trimming operation

Definition at line 257 of file iString.cpp.

References TrimHead(), and TrimTail().

iString Isis::iString::Trim ( const std::string &  chars  ) 

Removes characters from the beginning and end of the iString.

The order of the characters makes no difference.

Parameters:
chars The string of characters to be trimmed
Returns:
iString

Definition at line 240 of file iString.cpp.

References TrimHead(), and TrimTail().

Referenced by KernelDb::FindAll(), Isis::PvlTranslationManager::GetContainer(), Isis::UserInterface::GetNextParameter(), Isis::Mgs::MocLabels::InitWago(), spiceInit::kernelTypeEnum(), Isis::UserInterface::LoadBatchList(), Isis::Stretch::NextPair(), Isis::operator>>(), Isis::ProcessImportPds::ProcessPdsImageLabel(), Isis::ProcessImportPds::ProcessPdsQubeLabel(), and Isis::ProcessImportPds::TranslateIsis2Instrument().

std::string Isis::iString::TrimHead ( const std::string &  chars,
const std::string &  str 
) [static]

Trims the input characters from the beginning of the input string.

Parameters:
chars The input characters to be removed. Order makes no difference
str The string to be trimmed
Returns:
string The resulting string

Definition at line 282 of file iString.cpp.

iString Isis::iString::TrimHead ( const std::string &  chars  ) 

Trims The input characters from the beginning of the object iString.

Parameters:
chars The string of characters to be trimmed. Order makes no difference

Definition at line 269 of file iString.cpp.

Referenced by Isis::Stretch::NextPair(), Isis::Stretch::Parse(), Isis::FileList::Read(), Isis::PvlTokenizer::ReadToDoubleQuote(), Isis::PvlTokenizer::ReadToSingleQuote(), and Trim().

std::string Isis::iString::TrimTail ( const std::string &  chars,
const std::string &  str 
) [static]

Trims the input characters from the end of the input string.

Parameters:
chars The characters to be removed from the input string. Order does not matter, all characters are treated individually.
str The string to be trimmed
Returns:
string The result of the trimming

Definition at line 309 of file iString.cpp.

iString Isis::iString::TrimTail ( const std::string &  chars  ) 

Trims the input characters from the end of the object iString.

Parameters:
chars The string of characters to be removed. Order is irrelevant

Definition at line 294 of file iString.cpp.

Referenced by Isis::FileList::Read(), Isis::PvlTokenizer::ReadToDoubleQuote(), Isis::PvlTokenizer::ReadToSingleQuote(), Isis::Stretch::Text(), and Trim().

std::string Isis::iString::UpCase ( const std::string &  str  )  [static]

Converts lower case characters in the input string to upper case characters.

Parameters:
str The string to be converted
Returns:
string The result of the conversion

Definition at line 333 of file iString.cpp.

iString Isis::iString::UpCase (  ) 

Converst any lower case characters in the object iString with uppercase characters.

Definition at line 320 of file iString.cpp.

Referenced by Isis::PvlFormat::Accuracy(), Isis::SerialNumberList::Add(), Isis::PvlFormat::Add(), Isis::ByteOrderEnumeration(), Isis::CameraFactory::CameraVersion(), Isis::CameraFactory::Create(), Isis::Cube::Cube(), Isis::CubeFormatEnumeration(), Isis::Blob::Find(), KernelDb::FindAll(), Isis::PvlFormatPds::FormatBinary(), Isis::PvlFormatPds::FormatBool(), Isis::PvlFormatPds::FormatEnd(), Isis::PvlFormatPds::FormatEnum(), Isis::PvlFormatPds::FormatHex(), Isis::PvlFormatPds::FormatInteger(), Isis::PvlFormatPds::FormatName(), Isis::PvlFormatPds::FormatReal(), Isis::PvlFormatPds::FormatString(), Isis::PvlFormatPds::FormatUnknown(), Isis::PvlFormatPds::FormatValue(), Isis::AtmosModel::GenerateAhTable(), IsisAml::GetBoolean(), Isis::PvlTranslationManager::GetContainer(), Isis::Cube::HasTable(), Isis::IdealCamera::IdealCamera(), Isis::iException::iException(), spiceInit::kernelTypeEnum(), Isis::LabelAttachmentEnumeration(), Isis::PvlTokenizer::Load(), Isis::TableRecord::operator[](), Isis::PixelTypeEnumeration(), Isis::ProcessImport::ProcessBil(), Isis::ProcessImport::ProcessBip(), Isis::ProcessImport::ProcessBsq(), Isis::Progress::Progress(), Isis::RangeTypeEnumeration(), Isis::PvlKeyword::Reform(), IsisAml::ReturnParam(), Isis::AtmosModel::SetAtmosNulneg(), Isis::ProcessExportPds::StandardAllMapping(), IsisXMLParameter::startElement(), Isis::PvlKeyword::StringEqual(), Isis::StringToPixel(), Isis::ToKeywordType(), Isis::PvlFormat::Type(), and IsisAml::Verify().


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