MCPcopy Create free account
hub / github.com/DOI-USGS/ISIS3 / Token

Method Token

isis/src/core/src/IString.cpp:898–917  ·  view source on GitHub ↗

* 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. * * @deprecated * * @param separator The string of characters used to separate tokens. The

Source from the content-addressed store, hash-verified

896 * @return IString
897 */
898 IString IString::Token(const IString &separator) {
899 IString retstr = "" ;
900
901 for(unsigned int i = 0; i < size(); i++) {
902 for(unsigned int sep = 0; sep < separator.size(); sep++) {
903 if(separator[sep] == at(i)) {
904 retstr = substr(0, i);
905 replace(0, i + 1, "");
906 return retstr;
907 }
908 }
909 }
910
911 if(retstr == "") {
912 retstr = (*this);
913 replace(0, size(), "");
914 }
915
916 return retstr;
917 }
918
919 /**
920 * @brief Find separators between characters and split them into strings

Callers 15

ReadLabelsMethod · 0.80
InitWagoMethod · 0.80
addCommentWrappedMethod · 0.80
mainFunction · 0.80
parseLabelMethod · 0.80
parseLabelMethod · 0.80
fitsToJsonFunction · 0.80
SetBatchListMethod · 0.80
readMethod · 0.80
extractFitsLabelsMethod · 0.80
prepareCalculationsMethod · 0.80
SetPhotoPhaseListMethod · 0.80

Calls 2

atFunction · 0.85
sizeMethod · 0.45

Tested by 2

mainFunction · 0.64
DoitFunction · 0.64