Functions

ut_std_string.h File Reference

#include <string>
#include "ut_types.h"

Go to the source code of this file.

Functions

ABI_EXPORT std::string UT_escapeXML (const std::string &)
 replacement for UT_UTF8String::escapeXML escapes '<', '>', '"' and '&' in the current string
ABI_EXPORT std::string & UT_std_string_vprintf (std::string &inStr, const char *format, va_list args1) ABI_PRINTF_FORMAT(2
ABI_EXPORT std::string
&ABI_EXPORT std::string 
UT_std_string_sprintf (const char *inFormat,...) ABI_PRINTF_FORMAT(1
ABI_EXPORT std::string
&ABI_EXPORT std::string
ABI_EXPORT bool 
starts_with (const std::string &fullstring, const std::string &prefix)
 true if fullstring starts with exactly prefix.
ABI_EXPORT bool ends_with (const std::string &fullstring, const std::string &ending)
ABI_EXPORT std::string replace_all (const std::string &s, char oldc, char newc)
ABI_EXPORT std::string replace_all (const std::string &s, const std::string &olds, const std::string &news)
ABI_EXPORT std::string UT_XML_cloneNoAmpersands (const std::string &szSource)
ABI_EXPORT std::string UT_std_string_getPropVal (const std::string &sPropertyString, const std::string &sProp)
ABI_EXPORT void UT_std_string_removeProperty (std::string &sPropertyString, const std::string &sProp)
ABI_EXPORT void UT_std_string_setProperty (std::string &sPropertyString, const std::string &sProp, const std::string &sVal)
ABI_EXPORT const std::string StreamToString (std::istream &iss)
ABI_EXPORT std::string toTimeString (time_t TT)
ABI_EXPORT time_t toTime (struct tm *tm)
ABI_EXPORT time_t parseTimeString (const std::string &stddatestr)

Function Documentation

ABI_EXPORT bool ends_with ( const std::string &  fullstring,
const std::string &  ending 
)
ABI_EXPORT time_t parseTimeString ( const std::string &  stddatestr  ) 
ABI_EXPORT std::string replace_all ( const std::string &  s,
const std::string &  olds,
const std::string &  news 
)
ABI_EXPORT std::string replace_all ( const std::string &  s,
char  oldc,
char  newc 
)
ABI_EXPORT std::string& ABI_EXPORT std::string ABI_EXPORT bool starts_with ( const std::string &  fullstring,
const std::string &  prefix 
)
ABI_EXPORT const std::string StreamToString ( std::istream &  iss  ) 
ABI_EXPORT time_t toTime ( struct tm *  tm  ) 

Referenced by parseTimeString().

ABI_EXPORT std::string toTimeString ( time_t  TT  ) 
ABI_EXPORT std::string UT_escapeXML ( const std::string &   ) 
ABI_EXPORT std::string UT_std_string_getPropVal ( const std::string &  sPropertyString,
const std::string &  sProp 
)

Some functions to add/subtract and extract std::string properties from a std::string of properties.

Assuming a string of standard abiword properties eg. "fred:nerk; table-width:1.0in; table-height:10.in" Return the value of the property sProp or NULL if it is not present.

References UT_ASSERT, and UT_SHOULD_NOT_HAPPEN.

Referenced by ODi_TextContent_ListenerState::_openAbiSection(), IE_Imp_RTF::HandleAbiCell(), IE_Imp_RTF::HandleAbiMathml(), IE_Imp_RTF::HandleAbiTable(), and TFTEST_MAIN().

ABI_EXPORT void UT_std_string_removeProperty ( std::string &  sPropertyString,
const std::string &  sProp 
)

Assuming a string of standard abiword properties eg. "fred:nerk; table-width:1.0in; table-height:10.in" Remove the property sProp and it's value from the string of properties.

Referenced by IE_Imp_RTF::HandleAbiMathml(), IE_Imp_RTF::HandleAbiTable(), TFTEST_MAIN(), and UT_std_string_setProperty().

ABI_EXPORT void UT_std_string_setProperty ( std::string &  sPropertyString,
const std::string &  sProp,
const std::string &  sVal 
)

Assuming a string of standard abiword properties eg. "fred:nerk; table-width:1.0in; table-height:10.in" Add the property sProp with value sVal to the string of properties. If the property is already present, replace the old value with the new value.

References UT_std_string_removeProperty().

Referenced by IE_Imp_RTF::_setStringProperty(), IE_Imp_RTF::addFrame(), IE_Imp_RTF::closePastedTableIfNeeded(), IE_Imp_RTF::FlushCellProps(), IE_Imp_RTF::HandleAbiCell(), ODi_TextContent_ListenerState::startElement(), and TFTEST_MAIN().

ABI_EXPORT std::string& ABI_EXPORT std::string UT_std_string_sprintf ( const char *  inFormat,
  ... 
)
ABI_EXPORT std::string& UT_std_string_vprintf ( std::string &  inStr,
const char *  format,
va_list  args1 
)
ABI_EXPORT std::string UT_XML_cloneNoAmpersands ( const std::string &  szSource  )